klyn.math.Rational.hash
method
public override hash() as Long:
Description

Returns a value hash compatible with rational equality.

The numerator and denominator are reduced locally before hashing, so equivalent representations such as 1/2 and 2/4 produce the same value without mutating either rational number.

Returns

Hash of the normalized numerator and denominator.

Example
first = Rational(1, 2)
second = Rational(2, 4)
assert first == second
assert first.hash() == second.hash()