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 [*fixed* crate] now requires rustc version 1.31.1 or later.
|
||||||
* The [`traits`] module was added, with its traits [`Fixed`],
|
* The [`traits`] module was added, with its traits [`Fixed`],
|
||||||
[`FixedSigned`], [`FixedUnsigned`], [`FromFixed`], [`ToFixed`],
|
[`FixedSigned`], [`FixedUnsigned`], [`FromFixed`], [`ToFixed`],
|
||||||
[`LossyFrom`] and [`LossyInto`],.
|
[`LossyFrom`] and [`LossyInto`].
|
||||||
* The [`saturating_neg`] method was added to all fixed-point
|
* The [`saturating_neg`] method was added to all fixed-point
|
||||||
numbers, and the [`saturating_abs`] method was added to signed
|
numbers, and the [`saturating_abs`] method was added to signed
|
||||||
fixed-point numbers.
|
fixed-point numbers.
|
||||||
|
|
|
@ -22,9 +22,9 @@ number, and are rounded down at that precision.
|
||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
let pi: fixed::types::I8F8 = fixed::consts::PI.to_fixed();
|
let tau: fixed::types::I8F8 = fixed::consts::TAU.to_fixed();
|
||||||
println!("π with eight binary places is {:b}", pi);
|
println!("τ = 2π with eight binary places is {:b}", tau);
|
||||||
assert_eq!(format!("{:b}", pi), "11.00100100");
|
assert_eq!(format!("{:b}", tau), "110.01001000");
|
||||||
```
|
```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ use {
|
||||||
/// have to do so manually:
|
/// have to do so manually:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// ##[allow(unused_imports)]
|
/// # #[allow(unused_imports)]
|
||||||
/// use fixed::prelude::*;
|
/// use fixed::prelude::*;
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in New Issue