Expand description
Complex numbers over any RealFull type (f64 by default).
Division by zero and ln(0) etc. yield NaN/inf components, mirroring
std float semantics (no panics).
§Generic precision
Complex defaults to f64 components (Complex<T = f64>), so existing
code that writes Complex keeps working unchanged. C32 and C64 are
convenience aliases. The whole arithmetic suite is generic over
T: RealFull (conversion, powers, transcendental, trigonometric,
hyperbolic and float-classification operations), so Complex<f32>,
Complex<f64>, and any future RealFull type share the same code.
Several method names follow the cmath/numpy conventions for Python
parity: Complex::phase, Complex::to_polar, Complex::rect and
Complex::is_close.
Re-exports§
pub use analysis::ComplexAnalysis;pub use fft::fft;pub use fft::ifft;pub use matrix::ComplexMatrix;pub use polynomial::eval_polynomial;pub use polynomial::polynomial_roots;pub use special_functions::ComplexSpecialFunctions;
Modules§
- analysis
- Complex analysis: residues, contour integration, analytic continuation.
- fft
- Fast Fourier Transform (radix-2 Cooley–Tukey) and inverse FFT.
- matrix
- Complex matrix operations: arithmetic, decomposition, eigenvalues.
- polynomial
- Polynomial evaluation and root finding.
- special_
functions - Complex special functions: gamma, zeta, polylog, and related functions.
Structs§
- Complex
- Complex number
re + im·iover any real typeT(defaults tof64).
Functions§
- mandelbrot_
iterate - Iterate
z → z² + cuntil escape ormax_iterations. Returns the iteration count at which|z|² > escape_radius²(max_iterationsif the orbit never escapes). - mandelbrot_
smooth - Smooth iteration count for Mandelbrot coloring:
n + 1 − log₂(log|z|)at escape (fractional for smooth gradients).