toDouble

Returns this floating-point number as Double.


Calling from Kotlin

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

val number: StrictlyNegativeDouble = StrictlyNegativeDouble.create(-7)
val result: Double = number.toDouble()
println(result) // -7.0

Calling from Java

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

final StrictlyNegativeDouble number =
StrictlyNegativeDouble.Companion.create(-7);
final double result = number.toDouble();
System.out.println(result); // -7.0