toDouble

Returns this floating-point number as Double.


Calling from Kotlin

Here's an example of calling this function from Kotlin code:

val number = -7
val actual: Double = StrictlyNegativeDouble.create(number)
.toDouble()
val expected: Double = number.toDouble()
assertEquals(expected, actual)

Calling from Java

Here's an example of calling this function from Java code:

final Number number = -7;
final double actual = StrictlyNegativeDouble.Companion.create(number)
.toDouble();
final double expected = number.doubleValue();
Assertions.assertEquals(expected, actual);