nextTowards

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

Special cases:

  • x.nextTowards(y) is NaN if either x or y are NaN

  • x.nextTowards(x) == x

Since Kotlin

1.2

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

Special cases:

  • x.nextTowards(y) is NaN if either x or y are NaN

  • x.nextTowards(x) == x

Since Kotlin

1.2
inline fun Float.nextTowards(to: Float): Float(source)

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

Special cases:

  • x.nextTowards(y) is NaN if either x or y are NaN

  • x.nextTowards(x) == x

Since Kotlin

1.2

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

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

Special cases:

  • x.nextTowards(y) is NaN if either x or y are NaN

  • x.nextTowards(x) == x

Since Kotlin

1.2
external fun Float.nextTowards(to: Float): Float(source)

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

Special cases:

  • x.nextTowards(y) is NaN if either x or y are NaN

  • x.nextTowards(x) == x

Since Kotlin

1.3

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

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

Special cases:

  • x.nextTowards(y) is NaN if either x or y are NaN

  • x.nextTowards(x) == x

Since Kotlin

1.3

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

Special cases:

  • x.nextTowards(y) is NaN if either x or y are NaN

  • x.nextTowards(x) == x

Since Kotlin

1.8

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

Special cases:

  • x.nextTowards(y) is NaN if either x or y are NaN

  • x.nextTowards(x) == x

Since Kotlin

1.8