equals

operator override fun equals(other: Any?): Boolean

Returns true if the other object is a StrictlyNegativeDouble having the same value as this floating-point number, or returns false otherwise.


Calling from Kotlin

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

val number: Number = -23
val first: StrictlyNegativeDouble = StrictlyNegativeDouble.create(number)
val second: StrictlyNegativeDouble =
StrictlyNegativeDouble.create(number)
val result: Boolean = first == second // or first.equals(second)
println(result) // true

Calling from Java

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

final int number = -23;
final StrictlyNegativeDouble first =
StrictlyNegativeDouble.Companion.create(number);
final StrictlyNegativeDouble second =
StrictlyNegativeDouble.Companion.create(number);
final boolean result = first == second; // or first.equals(second)
System.out.println(result); // true