fixed/README.md

2.0 KiB
Raw Blame History

Fixed-point numbers

Fixed provides fixed-point numbers. It is not yet useful, as it is designed to depend on the as-yet unimplemented const generics compiler feature. (In the current code, the number of fractional bits is hard-coded to the arbitrary value 7, so if you need a fixed-point number with seven fractional bits, youre in luck!)

Using Fixed

Fixed is available on crates.io. To use Fixed in your crate, add it as a dependency inside Cargo.toml:

[dependencies]
fixed = "0.0.1"

You also need to declare it by adding this to your crate root (usually lib.rs or main.rs):

extern crate fixed;

Fixed requires const generics, which are not yet implemented in the compiler. When they are implemented, Fixed will require the nightly compiler until the feature makes it way to the stable release.

License

This crate is free software: you can redistribute it and/or modify it under the terms of either

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.