#arithmetic #floating-point #numeric

no-std spirix

Two's complement floating-point arithmetic library

1 unstable release

0.0.1 Feb 13, 2025

#154 in #floating-point

Download history 130/week @ 2025-02-12 2/week @ 2025-02-19 4/week @ 2025-02-26

136 downloads per month

Custom license

4KB

Spirix

A floating-point mathematics library implementing signed-normalized arithmetic with fully configurable fraction and exponent components.

Overview

Spirix provides two core types using sign-normalized fraction/exponent representation:

  • Circle<F, E>: Complex numbers with fraction F and shared exponent E
  • Scalar<F, E>: Real numbers with fraction F and exponent E

Normalization ensures consistent properties by moving the sign bit to a fixed position and aligning the first value bit, enabling:

  • Detection of undefined states (division by zero, etc.)
  • Clean handling of infantesimal (escaped) large/small values
  • Precise tracking of arithmetic undefined conditions
  • Accurate representation of special values (zero, infinities)

Features

  • Normalized Math: Consistent handling of all numeric edge cases
  • Configurable Precision: Any Rust signed integer type (i8-i128) for components
  • Full Math Support: Standard operations with error propagation
  • Type Safety: Component sizes checked/optimized at compile time
  • Clean Integration: Works with all Rust native numeric types

Status

This crate is currently under development. Full implementation coming soon.

Dependencies

~150KB