toDouble
Returns this floating-point number as Double.
Calling from Kotlin
Here's an example of calling this method from Kotlin code:
val number = -7
val actual: Double = StrictlyNegativeDouble.create(number)
.toDouble()
val expected: Double = number.toDouble()
assertEquals(expected, actual)
Content copied to clipboard
Calling from Java
Here's an example of calling this method from Java code:
final Number number = -7;
final double actual = StrictlyNegativeDouble.Companion.create(number)
.toDouble();
final double expected = number.doubleValue();
Assertions.assertEquals(expected, actual);
Content copied to clipboard