Expand description
Fixed-point math via CORDIC. No floating-point ops, no_std compatible.
§Quick Start
use fixed::types::I16F16;
use fixed_analytics::{sin, cos, sqrt, ln};
let angle = I16F16::from_num(0.5);
let (s, c) = (sin(angle), cos(angle));
let root = sqrt(I16F16::from_num(2.0)).unwrap();
let log = ln(I16F16::E).unwrap();§Precision
| Type | Accuracy |
|---|---|
I16F16 | ~4 decimal digits |
I32F32 | ~8 decimal digits |
§Features
std(default): Enablesstd::error::Errorimpl
See kernel module for algorithm details.
Re-exports§
pub use error::Error;pub use error::Result;pub use traits::CordicNumber;pub use ops::algebraic::sqrt;pub use ops::circular::acos;pub use ops::circular::asin;pub use ops::circular::atan;pub use ops::circular::atan2;pub use ops::circular::cos;pub use ops::circular::sin;pub use ops::circular::sin_cos;pub use ops::circular::tan;pub use ops::exponential::exp;pub use ops::exponential::ln;pub use ops::exponential::log2;pub use ops::exponential::log10;pub use ops::exponential::pow2;pub use ops::hyperbolic::acosh;pub use ops::hyperbolic::acoth;pub use ops::hyperbolic::asinh;pub use ops::hyperbolic::atanh;pub use ops::hyperbolic::cosh;pub use ops::hyperbolic::coth;pub use ops::hyperbolic::sinh;pub use ops::hyperbolic::sinh_cosh;pub use ops::hyperbolic::tanh;pub use fixed;
Modules§
- bounded
- Bounded value types that encode mathematical invariants at the type level.
- error
- Error types for CORDIC operations.
- kernel
- CORDIC (Coordinate Rotation Digital Computer) kernels.
- ops
- High-level mathematical operations built on CORDIC kernels.
- tables
- Precomputed lookup tables for CORDIC algorithms and polynomial evaluation.
- traits
- Trait definitions for types compatible with CORDIC algorithms.