Float

Represents a single-precision 32-bit IEEE 754 floating point number. On the JVM, non-nullable values of this type are represented as values of the primitive type float.

Since Kotlin

1.1

Represents a single-precision 32-bit IEEE 754 floating point number. On the JVM, non-nullable values of this type are represented as values of the primitive type float.

Since Kotlin

1.0

Types

Link copied to clipboard
object Companion
Since Kotlin 1.1
object Companion
Since Kotlin 1.0

Functions

Link copied to clipboard
fun Float.coerceAtLeast(minimumValue: Float): Float

Ensures that this value is not less than the specified minimumValue.

Since Kotlin 1.0
Link copied to clipboard
fun Float.coerceAtMost(maximumValue: Float): Float

Ensures that this value is not greater than the specified maximumValue.

Since Kotlin 1.0
Link copied to clipboard
fun Float.coerceIn(minimumValue: Float, maximumValue: Float): Float

Ensures that this value lies in the specified range minimumValue..maximumValue.

Since Kotlin 1.0
Link copied to clipboard
operator fun compareTo(other: Byte): Int
operator fun compareTo(other: Double): Int
open operator override fun compareTo(other: Float): Int
operator fun compareTo(other: Int): Int
operator fun compareTo(other: Long): Int
operator fun compareTo(other: Short): Int

Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.

Since Kotlin 1.1
operator fun compareTo(other: Byte): Int
operator fun compareTo(other: Double): Int
open operator override fun compareTo(other: Float): Int
operator fun compareTo(other: Int): Int
operator fun compareTo(other: Long): Int
operator fun compareTo(other: Short): Int

Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.

Since Kotlin 1.0
Link copied to clipboard
operator fun dec(): Float

Returns this value decremented by one.

Since Kotlin 1.1
operator fun dec(): Float

Returns this value decremented by one.

Since Kotlin 1.0
Link copied to clipboard
operator fun div(other: Byte): Float
operator fun div(other: Double): Double
operator fun div(other: Float): Float
operator fun div(other: Int): Float
operator fun div(other: Long): Float
operator fun div(other: Short): Float

Divides this value by the other value.

Since Kotlin 1.1
operator fun div(other: Byte): Float
operator fun div(other: Double): Double
operator fun div(other: Float): Float
operator fun div(other: Int): Float
operator fun div(other: Long): Float
operator fun div(other: Short): Float

Divides this value by the other value.

Since Kotlin 1.0
Link copied to clipboard
operator fun inc(): Float

Returns this value incremented by one.

Since Kotlin 1.1
operator fun inc(): Float

Returns this value incremented by one.

Since Kotlin 1.0
Link copied to clipboard
expect inline fun Float.isFinite(): Boolean

Returns true if the argument is a finite floating-point value; returns false otherwise (for NaN and infinity arguments).

Since Kotlin 1.0
Link copied to clipboard
expect inline fun Float.isInfinite(): Boolean

Returns true if this value is infinitely large in magnitude.

Since Kotlin 1.0
Link copied to clipboard
expect inline fun Float.isNaN(): Boolean

Returns true if the specified number is a Not-a-Number (NaN) value, false otherwise.

Since Kotlin 1.0
Link copied to clipboard
operator fun minus(other: Byte): Float
operator fun minus(other: Double): Double
operator fun minus(other: Float): Float
operator fun minus(other: Int): Float
operator fun minus(other: Long): Float
operator fun minus(other: Short): Float

Subtracts the other value from this value.

Since Kotlin 1.1
operator fun minus(other: Byte): Float
operator fun minus(other: Double): Double
operator fun minus(other: Float): Float
operator fun minus(other: Int): Float
operator fun minus(other: Long): Float
operator fun minus(other: Short): Float

Subtracts the other value from this value.

Since Kotlin 1.0
Link copied to clipboard
operator fun plus(other: Byte): Float
operator fun plus(other: Double): Double
operator fun plus(other: Float): Float
operator fun plus(other: Int): Float
operator fun plus(other: Long): Float
operator fun plus(other: Short): Float

Adds the other value to this value.

Since Kotlin 1.1
operator fun plus(other: Byte): Float
operator fun plus(other: Double): Double
operator fun plus(other: Float): Float
operator fun plus(other: Int): Float
operator fun plus(other: Long): Float
operator fun plus(other: Short): Float

Adds the other value to this value.

Since Kotlin 1.0
Link copied to clipboard

Creates a range from this Float value to the specified that value.

Since Kotlin 1.1

Creates a range from this Float value to the specified that value.

Since Kotlin 1.1
Link copied to clipboard
operator fun rem(other: Byte): Float
operator fun rem(other: Double): Double
operator fun rem(other: Float): Float
operator fun rem(other: Int): Float
operator fun rem(other: Long): Float
operator fun rem(other: Short): Float

Calculates the remainder of truncating division of this value by the other value.

Since Kotlin 1.1
operator fun rem(other: Byte): Float
operator fun rem(other: Double): Double
operator fun rem(other: Float): Float
operator fun rem(other: Int): Float
operator fun rem(other: Long): Float
operator fun rem(other: Short): Float

Calculates the remainder of truncating division of this value by the other value.

Since Kotlin 1.1
Link copied to clipboard
operator fun times(other: Byte): Float
operator fun times(other: Double): Double
operator fun times(other: Float): Float
operator fun times(other: Int): Float
operator fun times(other: Long): Float
operator fun times(other: Short): Float

Multiplies this value by the other value.

Since Kotlin 1.1
operator fun times(other: Byte): Float
operator fun times(other: Double): Double
operator fun times(other: Float): Float
operator fun times(other: Int): Float
operator fun times(other: Long): Float
operator fun times(other: Short): Float

Multiplies this value by the other value.

Since Kotlin 1.0
Link copied to clipboard
open override fun toByte(): Byte

Converts this Float value to Byte.

Since Kotlin 1.1
open override fun toByte(): Byte

Converts this Float value to Byte.

Since Kotlin 1.0
Link copied to clipboard
open override fun toChar(): Char

Converts this Float value to Char.

Since Kotlin 1.1
open override fun toChar(): Char

Converts this Float value to Char.

Since Kotlin 1.0
Link copied to clipboard
open override fun toDouble(): Double

Converts this Float value to Double.

Since Kotlin 1.1
open override fun toDouble(): Double

Converts this Float value to Double.

Since Kotlin 1.0
Link copied to clipboard
open override fun toFloat(): Float

Returns this value.

Since Kotlin 1.1
open override fun toFloat(): Float

Returns this value.

Since Kotlin 1.0
Link copied to clipboard
open override fun toInt(): Int

Converts this Float value to Int.

Since Kotlin 1.1
open override fun toInt(): Int

Converts this Float value to Int.

Since Kotlin 1.0
Link copied to clipboard
open override fun toLong(): Long

Converts this Float value to Long.

Since Kotlin 1.1
open override fun toLong(): Long

Converts this Float value to Long.

Since Kotlin 1.0
Link copied to clipboard
open override fun toShort(): Short

Converts this Float value to Short.

Since Kotlin 1.1
open override fun toShort(): Short

Converts this Float value to Short.

Since Kotlin 1.0
Link copied to clipboard
operator fun unaryMinus(): Float

Returns the negative of this value.

Since Kotlin 1.1
operator fun unaryMinus(): Float

Returns the negative of this value.

Since Kotlin 1.0
Link copied to clipboard
operator fun unaryPlus(): Float

Returns this value.

Since Kotlin 1.1
operator fun unaryPlus(): Float

Returns this value.

Since Kotlin 1.0