tweaks
This commit is contained in:
parent
b4baf7d15f
commit
4f1a9b3bd3
|
@ -44,7 +44,7 @@ numeric primitives are implemented. That is, you can use [`From`] or
|
|||
* The [*fixed* crate] now requires rustc version 1.31.1 or later.
|
||||
* The [`traits`] module was added, with its traits [`Fixed`],
|
||||
[`FixedSigned`], [`FixedUnsigned`], [`FromFixed`], [`ToFixed`],
|
||||
[`LossyFrom`] and [`LossyInto`],.
|
||||
[`LossyFrom`] and [`LossyInto`].
|
||||
* The [`saturating_neg`] method was added to all fixed-point
|
||||
numbers, and the [`saturating_abs`] method was added to signed
|
||||
fixed-point numbers.
|
||||
|
|
|
@ -22,9 +22,9 @@ number, and are rounded down at that precision.
|
|||
# Examples
|
||||
|
||||
```rust
|
||||
let pi: fixed::types::I8F8 = fixed::consts::PI.to_fixed();
|
||||
println!("π with eight binary places is {:b}", pi);
|
||||
assert_eq!(format!("{:b}", pi), "11.00100100");
|
||||
let tau: fixed::types::I8F8 = fixed::consts::TAU.to_fixed();
|
||||
println!("τ = 2π with eight binary places is {:b}", tau);
|
||||
assert_eq!(format!("{:b}", tau), "110.01001000");
|
||||
```
|
||||
*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue