code wiki / (root) / nx_complex.nx

nx_complex.nx

buildroot/runtime/nx_complex.nx

2479 B95 linesdepth 4pulls 5 transitivereach 36 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_complex.nx -- complex numbers (a + bi). Substrate-level complex arithmetic for theorems that need C. Components stored as i64 (or PPB-scaled for fractional). Real and imaginary parts independently. genealogy_id: cardano_1545 + bombelli_1572 + euler_1777 + hamilton_complex_form lineage_id: algebra_distributivity + commutativity + i_squared_minus_one axioms: NX_AX_ALG_DISTRIBUTIVITY, NX_AX_ALG_COMMUTATIVITY

dependencies 3 imports · 2 importers

syscalls.nx nx_axioms.nx nx_i128.nx nx_complex.nx nx_qed_freek.nx nx_theorems6_test.nx

imports: syscalls.nxnx_axioms.nxnx_i128.nx

imported by: nx_qed_freek.nxnx_theorems6_test.nx

structs

21struct Complex

consts

26const NX_COMPLEX_BYTES: i64 = 16

functions

28func nx_cx_alloc() -> *Complex
36func nx_cx_set(c: *Complex, re: i64, im: i64) -> i64
43func nx_cx_add(a: *Complex, b: *Complex, out: *Complex) -> i64
50func nx_cx_sub(a: *Complex, b: *Complex, out: *Complex) -> i64
57func nx_cx_mul(a: *Complex, b: *Complex, out: *Complex) -> i64
called by 1: nx_cx_pow calls 1: nx_muldiv_i64
64func nx_cx_conj(a: *Complex, out: *Complex) -> i64
71func nx_cx_norm_sq(a: *Complex) -> i64
calls 1: nx_muldiv_i64
76func nx_cx_eq(a: *Complex, b: *Complex) -> i64
83func nx_cx_pow(a: *Complex, n: i64, out: *Complex) -> i64