Expand description
Arbitrary-precision complex arithmetic for the OxiNum ecosystem.
Provides CBig, a complex number whose real and imaginary parts are
each a DBig (decimal arbitrary-precision float re-exported from
oxinum_float). Everything is Pure Rust — no GMP, no MPFR, no C/C++
— so the type works unchanged on every platform the rest of the
COOLJAPAN stack targets.
CBig is the high-level, decimal-backed front end. For a ground-up
binary-base complex built directly on oxinum_float::native::BigFloat
with explicit rounding-mode control, see native::BigComplex.
§Layout
A CBig is the ordered pair (re, im) representing re + im·i. The two
components are independent DBig values and may carry different
precisions; arithmetic and transcendental routines (added by sibling
modules) reconcile precision as needed.
§Why Hash, Eq, and Ord are not implemented
- No
Ord/PartialOrd. The complex field is not ordered: there is no order relation compatible with the ring structure, so any total order would be arbitrary and mathematically misleading. Callers who need a sort key should compare on a derived scalar (e.g. magnitude or the lexicographic(re, im)pair) explicitly. - No
Hash/Eq.CBigis built fromDBig, which deliberately does not implementcore::hash::Hash(distinct representations can compare equal across precisions, mirroring the IEEE-754 reasonsf32/f64skipHashin the standard library).PartialEqis provided (component-wise) where useful, but a lawfulEq/Hashpair would require a canonicalisation policy that varies by use case.
§Examples
use oxinum_complex::CBig;
let z = CBig::from_f64(3.0, 4.0).expect("finite parts");
// |3 + 4i|^2 = 9 + 16 = 25
assert_eq!(z.norm_sqr().to_string(), "25");Modules§
- native
- Native binary-base arbitrary-precision complex implementation built on
oxinum_float::native::BigFloat.
Structs§
Enums§
- OxiNum
Error - Errors from OxiNum operations.
Type Aliases§
- Complex
- Convenience alias for
CBig, mirroring theBigFloat = DBigconvention used throughout the OxiNum crates. - DBig
- Multi-precision float number with decimal exponent and HalfAway rounding mode
- OxiNum
Result - Convenience alias for
Result<T, OxiNumError>.