#type #no-alloc

no-std better-num

Better numeric types in rust

1 unstable release

0.1.0 Aug 18, 2023

#988 in Math

MIT license

6MB
132K SLoC

better-num

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: rustc or rust-analyzer may not like the size of some of these enum definitions, you have been warned.

Example:

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.

Language support

  • English
  • French
  • German
  • Italian

more to be added

License

This code is licensed under the MIT license.

No runtime deps

Features