previousSetBit

Platform and version requirements: Native (1.3)
fun previousSetBit(startIndex: Int): Int

Returns the biggest index of a bit which value is true before startIndex (inclusive). Returns -1 if there is no such bits before startIndex or if startIndex == -1. If startIndex >= size will search from (size - 1)-th bit.

Exceptions

IndexOutOfBoundException - if startIndex < -1.

© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native/-bit-set/previous-set-bit.html