| Crates.io | better-num |
| lib.rs | better-num |
| version | 0.1.0 |
| created_at | 2023-08-18 23:04:43.635391+00 |
| updated_at | 2023-08-18 23:04:43.635391+00 |
| description | Better numeric types in rust |
| homepage | |
| repository | https://github.com/adryzz/better-num |
| max_upload_size | |
| id | 948392 |
| size | 6,034,590 |
Rust numeric types that are easier to use
Note: due to space constraints, anything > 16 bits cannot be implemented, as it would take multiple gigabytes of space
NOTE:
rustcorrust-analyzermay not like the size of some of these enum definitions, you have been warned.
use better_num::english::u8::U8English;
fn main() {
dbg!(U8English::TwoHundredFiftyFour - U8English::TwoHundredThirtyFour);
// Twenty
}
Check the examples folder for more examples.
Due to the large size of the definitions, and to improve compilation speed you have to select exactly the types you want to use as features.
For example, if i want the U16English type, i have to select the features english and u16.
more to be added
This code is licensed under the MIT license.