Expand description
The numbers/rational domain: exact rational literals and values built over
bigint numerator/denominator pairs, their reduced arithmetic, and promotion
edges to and from the integer and f64 domains.
Structs§
- Rational
- An exact rational value: a numerator/denominator pair of integer values over
bigint, displayed in compact
num/denform when both parts are compact. - Rational
Number Domain - The exact rational number domain: parses
num/denliterals and declares the promotion edges to and from the integer andf64domains. - Rational
Numbers Lib - The library that installs the
numbers/rationaldomain: its literal class and shapes, theRationalvalue class, the reduced arithmetic ops, and the promotion rules to and from the integer andf64domains.
Functions§
- add_
symbol - The
math/addoperator symbol this domain installs a rational rule for. - div_
symbol - The
math/divoperator symbol this domain installs a rational rule for. - f64_
decimal_ to_ rational - Converts a finite decimal string (no exponent) into an exact reduced
numerator/denominator
BigIntpair, the basis of the f64 -> rational promotion. ReturnsNoneon empty, exponential, or malformed input. - f64_
domain - The
numbers/f64domain symbol, the far end of the rational <-> f64 promotion edges. - literal_
class_ symbol - The symbol of the rational literal class (the
Expr::Numberliteral shape in canonicalnum/denform). - literal_
instance_ shape_ symbol - The symbol of the shape matching individual rational literals, derived from
literal_class_symbol. - mul_
symbol - The
math/muloperator symbol this domain installs a rational rule for. - number_
domain - The
numbers/rationaldomain symbol shared by this crate’s literals, values, and ops. - parse_
rational_ parts - Parses a
num/denrational literal into a reduced numerator/denominatorBigIntpair, returningNoneon malformed text or a zero denominator. - pow_
symbol - The
math/powoperator symbol this domain installs a rational rule for. - rational_
value_ class_ symbol - The symbol of the
numbers/rationalvalue class, used to register the class and to tag the extension encoding of non-compact rational values. - sub_
symbol - The
math/suboperator symbol this domain installs a rational rule for.