Attributes
Members list
Type members
Inherited and Abstract types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Givens
Givens
Rational intentionally has no usable Eq: its mathematical equality is cross-multiplication (a/b == c/d iff a*d == c*b), which is non-structural and cannot be expressed by the structural-equality lowering. This given only produces a clear compile error if someone writes r1 === r2 / r1 == r2, or Eq.derived for a type with a Rational field. Use RationalEq.equals for value equality, or normalize for a reduced (lowest-terms) form that can be compared structurally.
Rational intentionally has no usable Eq: its mathematical equality is cross-multiplication (a/b == c/d iff a*d == c*b), which is non-structural and cannot be expressed by the structural-equality lowering. This given only produces a clear compile error if someone writes r1 === r2 / r1 == r2, or Eq.derived for a type with a Rational field. Use RationalEq.equals for value equality, or normalize for a reduced (lowest-terms) form that can be compared structurally.
Attributes
Extensions
Extensions
Reduce to lowest terms, with the sign carried on the numerator (denominator made positive). After normalization two equal-valued rationals share identical numerator/denominator, so they may be compared structurally.
Reduce to lowest terms, with the sign carried on the numerator (denominator made positive). After normalization two equal-valued rationals share identical numerator/denominator, so they may be compared structurally.