Skip to main content

Module domains

Module domains 

Source
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 direct bool -> i64 and bool -> f64 edges.
  • Signed fixed-width integers widen through i8 -> i16 -> i32 -> i64 -> i128; unsigned fixed-width integers widen through u8 -> u16 -> u32 -> u64 -> u128 and can cross to the next wider signed domain.
  • Fixed-width integers reach f32, f64, and rational; i64 also provides direct i64 -> f64 and i64 -> rational edges.
  • bigint is the arbitrary-precision integer domain and reaches rational.
  • f32 -> f64; f64 <-> rational when decimal rationalization succeeds.
  • i64, f64, and rational reach complex; complex is the scalar numeric sink before symbolic, function, or tensor lifting.
  • cas absorbs scalar domains through value promotion so symbolic arithmetic can mix CAS values with installed numeric domains.
  • tensor is value-only; tensor broadcast and typed tensor fast paths use explicit value descriptors rather than scalar promotion.

Functions§

arith
The numbers/arith symbol: the cross-domain arithmetic op namespace.
bigint
The numbers/bigint arbitrary-precision integer domain symbol.
bool
The numbers/bool domain symbol.
cas
The numbers/cas symbolic (computer-algebra) domain symbol.
cas_diff
The numbers/cas-diff symbolic-differentiation domain symbol.
cas_eval
The numbers/cas-eval symbolic-evaluation domain symbol.
cas_value_class
The numbers/Cas value-class symbol.
complex
The numbers/complex domain symbol (the scalar numeric sink).
complex_value_class
The numbers/Complex value-class symbol.
continued_fraction
The numbers/cf continued-fraction domain symbol.
domain
Build a symbol in the canonical numbers namespace.
f32
The numbers/f32 domain symbol.
f64
The numbers/f64 domain symbol.
fixed
The numbers/fixed fixed-point domain symbol.
fixed_integer_domains
All fixed-width integer domain symbols (i8..usize), in lattice order.
func
The numbers/func function-value domain symbol.
i8
The numbers/i8 domain symbol.
i16
The numbers/i16 domain symbol.
i32
The numbers/i32 domain symbol.
i64
The numbers/i64 domain symbol.
i128
The numbers/i128 domain symbol.
integer_domains
All integer domain symbols: the fixed-width set plus numbers/bigint.
isize
The numbers/isize domain symbol.
literal_class
The literal-class symbol for a domain, e.g. numbers/i64-literal.
numeric
The numbers/numeric namespace symbol for numeric utilities.
quad
The numbers/quad quadrature (numeric integration) domain symbol.
rational
The numbers/rational domain symbol.
rational_value_class
The numbers/Rational value-class symbol.
rk
The numbers/rk Runge-Kutta (numeric ODE) domain symbol.
tensor
The numbers/tensor domain symbol (value-only lift over scalar domains).
tensor_bcast
The numbers/tensor-bcast broadcasting tensor domain symbol.
tensor_linalg
The numbers/tensor-linalg linear-algebra tensor domain symbol.
tensor_value_class
The numbers/Tensor value-class symbol.
u8
The numbers/u8 domain symbol.
u16
The numbers/u16 domain symbol.
u32
The numbers/u32 domain symbol.
u64
The numbers/u64 domain symbol.
u128
The numbers/u128 domain symbol.
usize
The numbers/usize domain symbol.
value_shape
The value-shape symbol for domain, e.g. numbers/i64/value-shape.