Double

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

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

Represents a double-precision 64-bit IEEE 754 floating point number.

Types

Link copied to clipboard
object Companion
object Companion
object Companion

Functions

Link copied to clipboard
operator fun compareTo(other: Byte): Int
open operator override fun compareTo(other: Double): Int
operator 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.

operator fun compareTo(other: Byte): Int
open operator override fun compareTo(other: Double): Int
operator 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.

operator fun compareTo(other: Byte): Int
open operator override fun compareTo(other: Double): Int
operator 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.

Link copied to clipboard
operator fun dec(): Double

Decrements this value.

operator fun dec(): Double

Decrements this value.

operator external fun dec(): Double

Decrements this value.

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

Divides this value by the other value.

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

Divides this value by the other value.

inline operator fun div(other: Byte): Double
operator external fun div(other: Double): Double
inline operator fun div(other: Float): Double
inline operator fun div(other: Int): Double
inline operator fun div(other: Long): Double
inline operator fun div(other: Short): Double

Divides this value by the other value.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
fun equals(other: Double): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
operator fun inc(): Double

Increments this value.

operator fun inc(): Double

Increments this value.

operator external fun inc(): Double

Increments this value.

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

Subtracts the other value from this value.

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

Subtracts the other value from this value.

inline operator fun minus(other: Byte): Double
operator external fun minus(other: Double): Double
inline operator fun minus(other: Float): Double
inline operator fun minus(other: Int): Double
inline operator fun minus(other: Long): Double
inline operator fun minus(other: Short): Double

Subtracts the other value from this value.

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

Adds the other value to this value.

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

Adds the other value to this value.

inline operator fun plus(other: Byte): Double
operator external fun plus(other: Double): Double
inline operator fun plus(other: Float): Double
inline operator fun plus(other: Int): Double
inline operator fun plus(other: Long): Double
inline operator fun plus(other: Short): Double

Adds the other value to this value.

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

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

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

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

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

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

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

Multiplies this value by the other value.

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

Multiplies this value by the other value.

inline operator fun times(other: Byte): Double
operator external fun times(other: Double): Double
inline operator fun times(other: Float): Double
inline operator fun times(other: Int): Double
inline operator fun times(other: Long): Double
inline operator fun times(other: Short): Double

Multiplies this value by the other value.

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

Converts this Double value to Byte.

open override fun toByte(): Byte

Converts this Double value to Byte.

open override fun toByte(): Byte

Converts this Double value to Byte.

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

Converts this Double value to Char.

open override fun toChar(): Char

Converts this Double value to Char.

open override fun toChar(): Char

Converts this Double value to Char.

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

Returns this value.

open override fun toDouble(): Double

Returns this value.

open inline override fun toDouble(): Double

Returns this value.

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

Converts this Double value to Float.

open override fun toFloat(): Float

Converts this Double value to Float.

open external override fun toFloat(): Float

Converts this Double value to Float.

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

Converts this Double value to Int.

open override fun toInt(): Int

Converts this Double value to Int.

open external override fun toInt(): Int

Converts this Double value to Int.

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

Converts this Double value to Long.

open override fun toLong(): Long

Converts this Double value to Long.

open external override fun toLong(): Long

Converts this Double value to Long.

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

Converts this Double value to Short.

open override fun toShort(): Short

Converts this Double value to Short.

open override fun toShort(): Short

Converts this Double value to Short.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
operator fun unaryMinus(): Double

Returns the negative of this value.

operator fun unaryMinus(): Double

Returns the negative of this value.

operator external fun unaryMinus(): Double

Returns the negative of this value.

Link copied to clipboard
operator fun unaryPlus(): Double

Returns this value.

operator fun unaryPlus(): Double

Returns this value.

operator external fun unaryPlus(): Double

Returns this value.

Extensions

Link copied to clipboard

Returns the absolute value of this value.

Returns the absolute value of this value.

Returns the absolute value of this value.

Returns the absolute value of this value.

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

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

Link copied to clipboard
fun Double.coerceAtMost(maximumValue: Double): Double
fun Double.coerceAtMost(maximumValue: Double): Double
fun Double.coerceAtMost(maximumValue: Double): Double

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

Link copied to clipboard
fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double
fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double
fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun Double.IEEErem(divisor: Double): Double
inline fun Double.IEEErem(divisor: Double): Double
inline fun Double.IEEErem(divisor: Double): Double

Computes the remainder of division of this value by the divisor value according to the IEEE 754 standard.

external fun Double.IEEErem(divisor: Double): Double
external fun Double.IEEErem(divisor: Double): Double
external fun Double.IEEErem(divisor: Double): Double

Computes the remainder of division of this value by the divisor value according to the IEEE 754 standard.

Link copied to clipboard
expect fun Double.isFinite(): Boolean
expect fun Double.isFinite(): Boolean
expect fun Double.isFinite(): Boolean
actual inline fun Double.isFinite(): Boolean
actual inline fun Double.isFinite(): Boolean
actual inline fun Double.isFinite(): Boolean

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

actual fun Double.isFinite(): Boolean
actual fun Double.isFinite(): Boolean
actual fun Double.isFinite(): Boolean

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

actual external fun Double.isFinite(): Boolean
actual external fun Double.isFinite(): Boolean
actual external fun Double.isFinite(): Boolean

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

Link copied to clipboard
expect fun Double.isInfinite(): Boolean
expect fun Double.isInfinite(): Boolean
expect fun Double.isInfinite(): Boolean
actual inline fun Double.isInfinite(): Boolean
actual inline fun Double.isInfinite(): Boolean
actual inline fun Double.isInfinite(): Boolean

Returns true if this value is infinitely large in magnitude.

actual fun Double.isInfinite(): Boolean
actual fun Double.isInfinite(): Boolean
actual fun Double.isInfinite(): Boolean

Returns true if this value is infinitely large in magnitude.

actual external fun Double.isInfinite(): Boolean
actual external fun Double.isInfinite(): Boolean
actual external fun Double.isInfinite(): Boolean

Returns true if this value is infinitely large in magnitude.

Link copied to clipboard
expect fun Double.isNaN(): Boolean
expect fun Double.isNaN(): Boolean
expect fun Double.isNaN(): Boolean
actual inline fun Double.isNaN(): Boolean
actual inline fun Double.isNaN(): Boolean
actual inline fun Double.isNaN(): Boolean

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

actual fun Double.isNaN(): Boolean
actual fun Double.isNaN(): Boolean
actual fun Double.isNaN(): Boolean

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

actual external fun Double.isNaN(): Boolean
actual external fun Double.isNaN(): Boolean
actual external fun Double.isNaN(): Boolean

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

Link copied to clipboard
Link copied to clipboard
inline fun Double.mod(other: Float): Double
inline fun Double.mod(other: Double): Double
inline fun Double.mod(other: Float): Double
inline fun Double.mod(other: Double): Double
inline fun Double.mod(other: Float): Double
inline fun Double.mod(other: Double): Double

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

Link copied to clipboard
Link copied to clipboard
inline external fun <R : Number> Number.narrow(): R
inline external fun <R : Number> Number.narrow(): R
inline external fun <R : Number> Number.narrow(): R
Link copied to clipboard
expect fun Double.nextDown(): Double
expect fun Double.nextDown(): Double
expect fun Double.nextDown(): Double

Returns the Double value nearest to this value in direction of negative infinity.

actual inline fun Double.nextDown(): Double
actual inline fun Double.nextDown(): Double
actual inline fun Double.nextDown(): Double

Returns the Double value nearest to this value in direction of negative infinity.

actual fun Double.nextDown(): Double
actual fun Double.nextDown(): Double
actual fun Double.nextDown(): Double

Returns the Double value nearest to this value in direction of negative infinity.

actual external fun Double.nextDown(): Double
actual external fun Double.nextDown(): Double
actual external fun Double.nextDown(): Double

Returns the Double value nearest to this value in direction of negative infinity.

Link copied to clipboard
expect fun Double.nextTowards(to: Double): Double
expect fun Double.nextTowards(to: Double): Double
expect fun Double.nextTowards(to: Double): Double

Returns the Double value nearest to this value in direction from this value towards the value to.

actual inline fun Double.nextTowards(to: Double): Double
actual inline fun Double.nextTowards(to: Double): Double
actual inline fun Double.nextTowards(to: Double): Double

Returns the Double value nearest to this value in direction from this value towards the value to.

actual fun Double.nextTowards(to: Double): Double
actual fun Double.nextTowards(to: Double): Double
actual fun Double.nextTowards(to: Double): Double

Returns the Double value nearest to this value in direction from this value towards the value to.

actual external fun Double.nextTowards(to: Double): Double
actual external fun Double.nextTowards(to: Double): Double
actual external fun Double.nextTowards(to: Double): Double

Returns the Double value nearest to this value in direction from this value towards the value to.

Link copied to clipboard
expect fun Double.nextUp(): Double
expect fun Double.nextUp(): Double
expect fun Double.nextUp(): Double

Returns the Double value nearest to this value in direction of positive infinity.

actual inline fun Double.nextUp(): Double
actual inline fun Double.nextUp(): Double
actual inline fun Double.nextUp(): Double

Returns the Double value nearest to this value in direction of positive infinity.

actual fun Double.nextUp(): Double
actual fun Double.nextUp(): Double
actual fun Double.nextUp(): Double

Returns the Double value nearest to this value in direction of positive infinity.

actual external fun Double.nextUp(): Double
actual external fun Double.nextUp(): Double
actual external fun Double.nextUp(): Double

Returns the Double value nearest to this value in direction of positive infinity.

Link copied to clipboard
expect fun Double.pow(x: Double): Double
expect fun Double.pow(x: Double): Double
expect fun Double.pow(x: Double): Double

Raises this value to the power x.

expect fun Double.pow(n: Int): Double
expect fun Double.pow(n: Int): Double
expect fun Double.pow(n: Int): Double

Raises this value to the integer power n.

actual inline fun Double.pow(x: Double): Double
actual inline fun Double.pow(x: Double): Double
actual inline fun Double.pow(x: Double): Double

Raises this value to the power x.

actual inline fun Double.pow(n: Int): Double
actual inline fun Double.pow(n: Int): Double
actual inline fun Double.pow(n: Int): Double

Raises this value to the integer power n.

actual inline fun Double.pow(x: Double): Double
actual inline fun Double.pow(x: Double): Double
actual inline fun Double.pow(x: Double): Double

Raises this value to the power x.

actual inline fun Double.pow(n: Int): Double
actual inline fun Double.pow(n: Int): Double
actual inline fun Double.pow(n: Int): Double

Raises this value to the integer power n.

actual external fun Double.pow(x: Double): Double
actual external fun Double.pow(x: Double): Double
actual external fun Double.pow(x: Double): Double

Raises this value to the power x.

actual fun Double.pow(n: Int): Double
actual fun Double.pow(n: Int): Double
actual fun Double.pow(n: Int): Double

Raises this value to the integer power n.

Link copied to clipboard

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

Link copied to clipboard
expect fun Double.roundToInt(): Int
expect fun Double.roundToInt(): Int
expect fun Double.roundToInt(): Int

Rounds this Double value to the nearest integer and converts the result to Int. Ties are rounded towards positive infinity.

actual fun Double.roundToInt(): Int
actual fun Double.roundToInt(): Int
actual fun Double.roundToInt(): Int

Rounds this Double value to the nearest integer and converts the result to Int. Ties are rounded towards positive infinity.

actual fun Double.roundToInt(): Int
actual fun Double.roundToInt(): Int
actual fun Double.roundToInt(): Int

Rounds this Double value to the nearest integer and converts the result to Int. Ties are rounded towards positive infinity.

actual fun Double.roundToInt(): Int
actual fun Double.roundToInt(): Int
actual fun Double.roundToInt(): Int

Rounds this Double value to the nearest integer and converts the result to Int. Ties are rounded towards positive infinity.

Link copied to clipboard
expect fun Double.roundToLong(): Long
expect fun Double.roundToLong(): Long
expect fun Double.roundToLong(): Long

Rounds this Double value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.

actual fun Double.roundToLong(): Long
actual fun Double.roundToLong(): Long
actual fun Double.roundToLong(): Long

Rounds this Double value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.

actual fun Double.roundToLong(): Long
actual fun Double.roundToLong(): Long
actual fun Double.roundToLong(): Long

Rounds this Double value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.

actual fun Double.roundToLong(): Long
actual fun Double.roundToLong(): Long
actual fun Double.roundToLong(): Long

Rounds this Double value to the nearest integer and converts the result to Long. Ties are rounded towards positive infinity.

Link copied to clipboard
Link copied to clipboard
expect val Double.sign: Double
expect val Double.sign: Double
expect val Double.sign: Double

Returns the sign of this value:

actual val Double.sign: Double
actual val Double.sign: Double
actual val Double.sign: Double

Returns the sign of this value:

actual val Double.sign: Double
actual val Double.sign: Double
actual val Double.sign: Double

Returns the sign of this value:

actual val Double.sign: Double
actual val Double.sign: Double
actual val Double.sign: Double

Returns the sign of this value:

Link copied to clipboard
inline external fun <R : Number> Number.signExtend(): R
inline external fun <R : Number> Number.signExtend(): R
inline external fun <R : Number> Number.signExtend(): R
Link copied to clipboard
inline operator fun Double.times(duration: Duration): Duration
inline operator fun Double.times(duration: Duration): Duration
inline operator fun Double.times(duration: Duration): Duration

Returns a duration whose value is the specified duration value multiplied by this number.

Link copied to clipboard
inline fun Double.toBigDecimal(mathContext: MathContext): BigDecimal
inline fun Double.toBigDecimal(mathContext: MathContext): BigDecimal
inline fun Double.toBigDecimal(mathContext: MathContext): BigDecimal

Returns the value of this Double number as a BigDecimal.

Link copied to clipboard
expect fun Double.toBits(): Long
expect fun Double.toBits(): Long
expect fun Double.toBits(): Long

Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout.

actual inline fun Double.toBits(): Long
actual inline fun Double.toBits(): Long
actual inline fun Double.toBits(): Long

Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout.

actual fun Double.toBits(): Long
actual fun Double.toBits(): Long
actual fun Double.toBits(): Long

Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout.

actual inline fun Double.toBits(): Long
actual inline fun Double.toBits(): Long
actual inline fun Double.toBits(): Long

Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout.

Link copied to clipboard
Link copied to clipboard
expect fun Double.toRawBits(): Long
expect fun Double.toRawBits(): Long
expect fun Double.toRawBits(): Long

Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout, preserving NaN values exact layout.

actual inline fun Double.toRawBits(): Long
actual inline fun Double.toRawBits(): Long
actual inline fun Double.toRawBits(): Long

Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout, preserving NaN values exact layout.

actual fun Double.toRawBits(): Long
actual fun Double.toRawBits(): Long
actual fun Double.toRawBits(): Long

Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout, preserving NaN values exact layout.

actual inline fun Double.toRawBits(): Long
actual inline fun Double.toRawBits(): Long
actual inline fun Double.toRawBits(): Long

Returns a bit representation of the specified floating-point value as Long according to the IEEE 754 floating-point "double format" bit layout, preserving NaN values exact layout.

Link copied to clipboard
inline fun Double.toUInt(): UInt
inline fun Double.toUInt(): UInt
inline fun Double.toUInt(): UInt

Converts this Double value to UInt.

Link copied to clipboard
inline fun Double.toULong(): ULong
inline fun Double.toULong(): ULong
inline fun Double.toULong(): ULong

Converts this Double value to ULong.

Link copied to clipboard
expect val Double.ulp: Double
expect val Double.ulp: Double
expect val Double.ulp: Double

Returns the ulp (unit in the last place) of this value.

actual val Double.ulp: Double
actual val Double.ulp: Double
actual val Double.ulp: Double

Returns the ulp (unit in the last place) of this value.

actual val Double.ulp: Double
actual val Double.ulp: Double
actual val Double.ulp: Double

Returns the ulp (unit in the last place) of this value.

actual val Double.ulp: Double
actual val Double.ulp: Double
actual val Double.ulp: Double

Returns the ulp (unit in the last place) of this value.

Link copied to clipboard
expect fun Double.withSign(sign: Double): Double
expect fun Double.withSign(sign: Int): Double
expect fun Double.withSign(sign: Double): Double
expect fun Double.withSign(sign: Int): Double
expect fun Double.withSign(sign: Double): Double
expect fun Double.withSign(sign: Int): Double

Returns this value with the sign bit same as of the sign value.

actual inline fun Double.withSign(sign: Double): Double
actual inline fun Double.withSign(sign: Int): Double
actual inline fun Double.withSign(sign: Double): Double
actual inline fun Double.withSign(sign: Int): Double
actual inline fun Double.withSign(sign: Double): Double
actual inline fun Double.withSign(sign: Int): Double

Returns this value with the sign bit same as of the sign value.

actual fun Double.withSign(sign: Double): Double
actual inline fun Double.withSign(sign: Int): Double
actual fun Double.withSign(sign: Double): Double
actual inline fun Double.withSign(sign: Int): Double
actual fun Double.withSign(sign: Double): Double
actual inline fun Double.withSign(sign: Int): Double

Returns this value with the sign bit same as of the sign value.

actual external fun Double.withSign(sign: Double): Double
actual fun Double.withSign(sign: Int): Double
actual external fun Double.withSign(sign: Double): Double
actual fun Double.withSign(sign: Int): Double
actual external fun Double.withSign(sign: Double): Double
actual fun Double.withSign(sign: Int): Double

Returns this value with the sign bit same as of the sign value.