https://github.com/elefthei/dyadic-rust
An efficient implementation of dyadic numbers in Rust
https://github.com/elefthei/dyadic-rust
Last synced: 10 months ago
JSON representation
An efficient implementation of dyadic numbers in Rust
- Host: GitHub
- URL: https://github.com/elefthei/dyadic-rust
- Owner: elefthei
- License: mit
- Created: 2024-10-27T16:13:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-10T20:40:38.000Z (over 1 year ago)
- Last Synced: 2025-04-11T21:19:38.172Z (about 1 year ago)
- Language: Rust
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dyadic-rationals
**dyadic-rationals** is a Rust library for performing symbolic algebra with dyadic rational numbers. Dyadic rationals, or binary rationals, are numbers that can be expressed as fractions with a power of two as the denominator (e.g., `1/2`, `3/2`, `3/8`). These numbers have finite binary representations, making them ideal for precise approximations in computer science and mathematics.
### Features
- **Arithmetic Operations**: Supports addition, subtraction, and multiplication, which maintain closure within the dyadic rational ring.
- **Division by Powers of Two**: Includes division by powers of two, ensuring the result remains within the set of dyadic rationals.
- **Exact Fractional Representation**: Represents dyadic numbers in their exact fractional form to avoid rounding errors.
- **Simple API**: Provides a clear interface for algebraic operations on dyadic numbers, designed for ease of use in symbolic calculations.
### Mathematical Background
Dyadic rationals form a ring, closed under addition, subtraction, multiplication, and division by powers of two. These properties make dyadic rationals valuable in applications requiring precise, finite representations, including numerical analysis, cryptography, and formal verification.