← Docs
kotlin-stdlib / kotlin / Float / toShort

toShort

Common
JVM
JS
Native
1.0
@DeprecatedSinceKotlin ( "1.3" , "1.5" ) fun toShort ( ) : Short
(Common source) (Native source)
Deprecated: Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.

Converts this Float value to Short .

The resulting Short value is equal to this.toInt().toShort() .

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 .