fixed/README.md

56 lines
1.7 KiB
Markdown
Raw Normal View History

2018-08-09 11:02:34 -07:00
<!-- Copyright © 2018 Trevor Spiteri -->
<!-- Copying and distribution of this file, with or without
modification, are permitted in any medium without royalty provided the
copyright notice and this notice are preserved. This file is offered
as-is, without any warranty. -->
# Fixed-point numbers
2018-08-10 08:45:08 -07:00
Fixed provides fixed-point numbers. Currently it uses the
[typenum][typenum crate] for the fractional bit count; it is planned
to move to [const generics] when they are implemented by the Rust
compiler.
2018-08-09 11:02:34 -07:00
2018-08-10 02:13:42 -07:00
## Using Fixed
Fixed is available on [crates.io][fixed crate]. To use Fixed in your
crate, add it as a dependency inside [*Cargo.toml*]:
```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*):
```rust
extern crate fixed;
```
## License
2018-08-10 02:34:17 -07:00
This crate is free software: you can redistribute it and/or modify it
under the terms of either
2018-08-10 02:13:42 -07:00
2018-08-10 02:34:17 -07:00
* the [Apache License, Version 2.0][LICENSE-APACHE] or
* the [MIT License][LICENSE-MIT]
2018-08-10 02:13:42 -07:00
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.
[*Cargo.toml*]: https://doc.rust-lang.org/cargo/guide/dependencies.html
[LICENSE-APACHE]: https://www.apache.org/licenses/LICENSE-2.0
[LICENSE-MIT]: https://opensource.org/licenses/MIT
[channels]: https://doc.rust-lang.org/book/second-edition/appendix-07-nightly-rust.html
2018-08-09 11:02:34 -07:00
[const generics]: https://github.com/rust-lang/rust/issues/44580
2018-08-10 02:13:42 -07:00
[fixed crate]: https://crates.io/crates/fixed
2018-08-10 08:45:08 -07:00
[typenum crate]: https://crates.io/crates/typenum