← Docs
kotlin-stdlib / kotlin / Double / toInt

toInt

Common
JVM
JS
Native
1.0
fun toInt ( ) : Int
(Common source) (Native source)

Converts this Double value to Int .

The fractional part, if any, is rounded down towards zero. Returns zero if this Double value is NaN , Int.MIN_VALUE if it's less than Int.MIN_VALUE , Int.MAX_VALUE if it's bigger than Int.MAX_VALUE .

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