Crates.io | i24 |
lib.rs | i24 |
version | 1.0.1 |
source | src |
created_at | 2024-07-31 10:40:50.331165 |
updated_at | 2024-07-31 10:48:03.641597 |
description | A Rust library for working with 24-bit integers. |
homepage | |
repository | https://github.com/jmg049/i24 |
max_upload_size | |
id | 1320813 |
size | 22,684 |
i24
provides a 24-bit signed integer type for Rust, filling the gap between i16
and i32
. This type is particularly useful in audio processing, certain embedded systems, and other scenarios where 24-bit precision is required but 32 bits would be excessive.
i32
Debug
, Display
, PartialEq
, Eq
, PartialOrd
, Ord
, and Hash
Add this to your Cargo.toml
:
[dependencies]
i24 = "1.0.0"
use i24::i24;
let a = i24::from_i32(1000);
let b = i24::from_i32(2000);
let c = a + b;
assert_eq!(c.to_i32(), 3000);
i24
is [-8,388,608, 8,388,607].i32
.Contributions are welcome! Please feel free to submit a Pull Request. This project needs more testing and verification.
This project is licensed under the MIT License - see the LICENSE file for details.
This crate was developed as part of the Wavers project, a Wav file reader and writer for Rust.