v1.8.10
  • Solutions
    • Multiplatform Mobile
    • Multiplatform for other platforms
    • Server-side
    • Web frontend
    • Data science
    • Android
  • Docs
  • Community
  • Teach
  • Play
    • Playground
    • Hands-on
    • Examples
    • Koans
← Docs
kotlin-stdlib / kotlin.native / BitSet / previousSetBit

previousSetBit

Native
1.3
fun previousSetBit(startIndex: Int): Int
(source)

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.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Kotlin™ is protected under the Kotlin Foundation and licensed under the Apache 2 license.
Supported and developed by JetBrains