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 method from Kotlin code:

val number: Number = -23
val first: StrictlyNegativeDouble =
StrictlyNegativeDouble.create(number)
val second: StrictlyNegativeDouble =
StrictlyNegativeDouble.create(number)
val actual: Boolean = first == second // or first.equals(second)
assertTrue(actual)

Calling from Java

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

final Number number = -23;
final StrictlyNegativeDouble first =
StrictlyNegativeDouble.Companion.create(number);
final StrictlyNegativeDouble second =
StrictlyNegativeDouble.Companion.create(number);
final boolean actual = first.equals(second);
Assertions.assertTrue(actual);