public static operator==(readonly notnull r1 as Rational, readonly notnull r2 as Rational) as Boolean
Value equality between two rational numbers.
Fractions are compared by cross-multiplication so reduced and non-reduced forms are considered equal (ex: 1/2 == 4/8). Products are evaluated as Long to preserve all Int component values.
| Parameter | Description |
|---|---|
r1 | First rational number. |
r2 | Second rational number. |
True when both values represent the same rational quantity.
assert Rational(1, 2) == Rational(4, 8) assert Rational(1, 65536) != Rational(65537, 65536)