hashCode

override fun hashCode(): Int

Returns a hash code value for this floating-point number.


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.hashCode() == second.hashCode()
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.hashCode() == second.hashCode();
System.out.println(result); // true