#algebra #symbolic #dyadic

nightly bin+lib dyadic-rationals

Binary and Dyadic rational expressions (with binders) in Rust

3 releases

0.1.2 Nov 5, 2024
0.1.1 Nov 3, 2024
0.1.0 Oct 31, 2024

#57 in #symbolic

Download history 104/week @ 2024-10-26 298/week @ 2024-11-02 25/week @ 2024-11-09

427 downloads per month

Custom license

63KB
2K SLoC

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.

Dependencies

~1.5MB
~23K SLoC