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

#373 in Algorithms

Download history 23/week @ 2024-08-20 53/week @ 2024-09-10 24/week @ 2024-09-17 9/week @ 2024-09-24 8/week @ 2024-10-01 1/week @ 2024-10-08 206/week @ 2024-10-15 18/week @ 2024-10-22 147/week @ 2024-10-29 16/week @ 2024-11-05 9/week @ 2024-11-19 102/week @ 2024-11-26 204/week @ 2024-12-03

315 downloads per month
Used in 20 crates (9 directly)

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