untest fixed-macro example until rustc 1.45.0 requirement
This commit is contained in:
parent
4c1595c562
commit
c3e1e1c8b3
|
@ -34,7 +34,6 @@ num-traits = { version = "0.2.12", default-features = false, optional = true }
|
||||||
serde = { version = "1.0.60", default-features = false, optional = true }
|
serde = { version = "1.0.60", default-features = false, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
fixed-macro = "1"
|
|
||||||
rand = { version = "0.7", default-features = false }
|
rand = { version = "0.7", default-features = false }
|
||||||
rand_xoshiro = "0.4"
|
rand_xoshiro = "0.4"
|
||||||
criterion = "0.3"
|
criterion = "0.3"
|
||||||
|
|
|
@ -146,12 +146,14 @@ The [*fixed-macro* crate] provides a convenient macro to write down
|
||||||
fixed-point constants literally in the code.
|
fixed-point constants literally in the code.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
# #[cfg!(feature = "add-fixed-macro-dev-dependency-on-rustc-version-bump")] {
|
||||||
use fixed::types::I16F16;
|
use fixed::types::I16F16;
|
||||||
use fixed_macro::fixed;
|
use fixed_macro::fixed;
|
||||||
|
|
||||||
const NUM1: I16F16 = fixed!(12.75: I16F16);
|
const NUM1: I16F16 = fixed!(12.75: I16F16);
|
||||||
let num2 = NUM1 + fixed!(13.125: I16F16);
|
let num2 = NUM1 + fixed!(13.125: I16F16);
|
||||||
assert_eq!(num2, 25.875);
|
assert_eq!(num2, 25.875);
|
||||||
|
# }
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using the *fixed* crate
|
## Using the *fixed* crate
|
||||||
|
|
Loading…
Reference in New Issue