Swift Numerics is a foundational library that extends the Swift standard library with essential numerical protocols, types, and functions needed for scientific and systems programming. It defines generic abstractions over real and complex numbers so algorithms can be written once and work across concrete floating-point types. The package includes RealModule utilities and a full Complex type with the expected arithmetic and transcendental functions, bridging a long-standing gap for numerics in Swift. API design follows Swift’s emphasis on value semantics and protocol-oriented programming, enabling compiler optimizations and predictable performance. The modules are factored to keep dependencies minimal and to allow adopters to pull in only what they need. As a result, Swift Numerics underpins higher-level libraries in simulation, signal processing, and machine learning written in pure Swift.
Features
- Protocols and utilities for generic real arithmetic
- First-class Complex number type with arithmetic and transcendental ops
- Consistent numerics API aligned with Swift language design
- Minimal, modular packages to keep builds lean
- Performance-friendly value semantics and static dispatch
- Building block for scientific, DSP, and ML libraries in Swift