Expand description
Canonical symbols for the number-domain family.
Concrete number crates should import these helpers instead of spelling
Symbol::qualified("numbers", "...") locally. Keeping the symbols in one
place makes promotion edges auditable: a typo cannot silently create an
unreachable domain.
§Promotion lattice
The default number prelude installs a directed promotion graph. Literal promotion rules are a fast path; every edge that participates in dispatch also has a value-promotion rule so opaque number values can move through the same lattice.
Intended scalar reachability:
bool -> u8 -> ..., plus directbool -> i64andbool -> f64edges.- Signed fixed-width integers widen through
i8 -> i16 -> i32 -> i64 -> i128; unsigned fixed-width integers widen throughu8 -> u16 -> u32 -> u64 -> u128and can cross to the next wider signed domain. - Fixed-width integers reach
f32,f64, andrational;i64also provides directi64 -> f64andi64 -> rationaledges. bigintis the arbitrary-precision integer domain and reachesrational.f32 -> f64;f64 <-> rationalwhen decimal rationalization succeeds.i64,f64, andrationalreachcomplex;complexis the scalar numeric sink before symbolic, function, or tensor lifting.casabsorbs scalar domains through value promotion so symbolic arithmetic can mix CAS values with installed numeric domains.tensoris value-only; tensor broadcast and typed tensor fast paths use explicit value descriptors rather than scalar promotion.
Functions§
- arith
- The
numbers/arithsymbol: the cross-domain arithmetic op namespace. - bigint
- The
numbers/bigintarbitrary-precision integer domain symbol. - bool
- The
numbers/booldomain symbol. - cas
- The
numbers/cassymbolic (computer-algebra) domain symbol. - cas_
diff - The
numbers/cas-diffsymbolic-differentiation domain symbol. - cas_
eval - The
numbers/cas-evalsymbolic-evaluation domain symbol. - cas_
value_ class - The
numbers/Casvalue-class symbol. - complex
- The
numbers/complexdomain symbol (the scalar numeric sink). - complex_
value_ class - The
numbers/Complexvalue-class symbol. - continued_
fraction - The
numbers/cfcontinued-fraction domain symbol. - domain
- Build a symbol in the canonical
numbersnamespace. - f32
- The
numbers/f32domain symbol. - f64
- The
numbers/f64domain symbol. - fixed
- The
numbers/fixedfixed-point domain symbol. - fixed_
integer_ domains - All fixed-width integer domain symbols (
i8..usize), in lattice order. - func
- The
numbers/funcfunction-value domain symbol. - i8
- The
numbers/i8domain symbol. - i16
- The
numbers/i16domain symbol. - i32
- The
numbers/i32domain symbol. - i64
- The
numbers/i64domain symbol. - i128
- The
numbers/i128domain symbol. - integer_
domains - All integer domain symbols: the fixed-width set plus
numbers/bigint. - isize
- The
numbers/isizedomain symbol. - literal_
class - The literal-class symbol for a domain, e.g.
numbers/i64-literal. - numeric
- The
numbers/numericnamespace symbol for numeric utilities. - quad
- The
numbers/quadquadrature (numeric integration) domain symbol. - rational
- The
numbers/rationaldomain symbol. - rational_
value_ class - The
numbers/Rationalvalue-class symbol. - rk
- The
numbers/rkRunge-Kutta (numeric ODE) domain symbol. - tensor
- The
numbers/tensordomain symbol (value-only lift over scalar domains). - tensor_
bcast - The
numbers/tensor-bcastbroadcasting tensor domain symbol. - tensor_
linalg - The
numbers/tensor-linalglinear-algebra tensor domain symbol. - tensor_
value_ class - The
numbers/Tensorvalue-class symbol. - u8
- The
numbers/u8domain symbol. - u16
- The
numbers/u16domain symbol. - u32
- The
numbers/u32domain symbol. - u64
- The
numbers/u64domain symbol. - u128
- The
numbers/u128domain symbol. - usize
- The
numbers/usizedomain symbol. - value_
shape - The value-shape symbol for
domain, e.g.numbers/i64/value-shape.