Skip to main content

Crate sim_lib_numbers_complex

Crate sim_lib_numbers_complex 

Source
Expand description

The numbers/complex domain: complex literals and values, their arithmetic, and the promotion edges from i64, f64, and rational into the complex sink of the scalar lattice.

Structs§

ComplexNumberDomain
The complex number domain at the sink of the scalar promotion lattice: parses a+bi literals and accepts the widening edges from f64, i64, and rational.
ComplexNumbersLib
The library that installs the numbers/complex domain: its literal class and shapes, the ComplexValue class, the complex ops, and the incoming promotion rules from f64, i64, and rational.
ComplexValue
A complex number value: real and imaginary parts over an f64 base scalar.

Functions§

add_symbol
The math/add operator symbol this domain installs a complex rule for.
canonical_complex
Renders (real, imag) parts into the canonical a+bi literal form, fixing the imaginary sign and normalizing negative zero via canonical_f64.
canonical_f64
Renders an f64 part for inclusion in a complex literal, normalizing the -0 rendering to 0.
complex_value
Constructs an opaque numbers/complex value from finite real and imaginary parts, erroring when either part is non-finite.
complex_value_class_symbol
The symbol of the numbers/complex value class, used to register the class and to tag the read-constructor encoding of complex values.
div_symbol
The math/div operator symbol this domain installs a complex rule for.
f64_domain
The numbers/f64 domain symbol, source of the f64 -> complex promotion edge.
i64_domain
The numbers/i64 domain symbol, source of the i64 -> complex promotion edge.
literal_class_symbol
The symbol of the complex literal class (the Expr::Number literal shape in canonical a+bi form).
literal_instance_shape_symbol
The symbol of the shape matching individual complex literals, derived from literal_class_symbol.
mul_symbol
The math/mul operator symbol this domain installs a complex rule for.
neg_symbol
The math/neg operator symbol this domain installs a complex rule for.
number_domain
The numbers/complex domain symbol shared by this crate’s literals, values, and ops.
parse_complex_literal
Parses a canonical a+bi complex literal into its (real, imag) parts, returning None when the text is not a well-formed complex literal.
parse_rational_as_f64
Parses a num/den rational literal to its f64 value for the rational -> complex promotion, returning None on malformed text or a zero denominator.
product_symbol
The math/product reduction operator symbol this domain installs a complex rule for.
rational_domain
The numbers/rational domain symbol, source of the rational -> complex promotion edge.
sub_symbol
The math/sub operator symbol this domain installs a complex rule for.
sum_symbol
The math/sum reduction operator symbol this domain installs a complex rule for.