public override hash() as Long:
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.
Hash of the normalized numerator and denominator.
first = Rational(1, 2) second = Rational(2, 4) assert first == second assert first.hash() == second.hash()