17 releases

0.0.17 Oct 29, 2024
0.0.16 Oct 18, 2024
0.0.15 Aug 18, 2024
0.0.11 Jul 30, 2024
0.0.3 Feb 26, 2024

#533 in Algorithms

Download history 1/week @ 2024-07-20 734/week @ 2024-07-27 67/week @ 2024-08-03 7/week @ 2024-08-10 131/week @ 2024-08-17 7/week @ 2024-08-24 2/week @ 2024-09-07 71/week @ 2024-09-14 12/week @ 2024-09-21 9/week @ 2024-09-28 61/week @ 2024-10-12 159/week @ 2024-10-19 132/week @ 2024-10-26 29/week @ 2024-11-02

381 downloads per month
Used in 2 crates

MIT license

32KB
1.5K SLoC

Fixed32

Fixed32 is a Rust crate providing a 32-bit fixed-point number type. It is designed for applications requiring deterministic behavior with low precision and small numerical ranges, such as games or embedded systems. This type is particularly useful in situations where floating-point arithmetic might introduce variability or unnecessary overhead.

Overview

  • Type: Fp
  • Precision: 16.16 fixed-point format (16 bits for integer, 16 bits for fractional)
  • Integer Range: -32768 to +32767
  • Decimal Precision: The 16.16 fixed-point format provides approximately 4 decimal places of precision (e.g., if 1 unit equals 1 meter, the precision is about 0.1 millimeters)

Features

  • Deterministic Arithmetic: Ensures consistent results across different platforms and runs.
  • Low Overhead: Efficient fixed-point arithmetic suitable for performance-critical applications.
  • Range Handling: Suitable for scenarios with small numerical ranges.

Installation

To use fixed32 in your Rust project, add it to your Cargo.toml:

fixed32 = "0.0.16"

License

This project is licensed under the MIT License. See the LICENSE file for more details.

No runtime deps