]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/floating_point_exp.rs
Auto merge of #93397 - joshtriplett:sort-floats, r=Amanieu
[rust.git] / src / tools / clippy / tests / ui / floating_point_exp.rs
1 // run-rustfix
2 #![warn(clippy::imprecise_flops)]
3
4 fn main() {
5     let x = 2f32;
6     let _ = x.exp() - 1.0;
7     let _ = x.exp() - 1.0 + 2.0;
8     // Cases where the lint shouldn't be applied
9     let _ = x.exp() - 2.0;
10     let _ = x.exp() - 1.0 * 2.0;
11
12     let x = 2f64;
13     let _ = x.exp() - 1.0;
14     let _ = x.exp() - 1.0 + 2.0;
15     // Cases where the lint shouldn't be applied
16     let _ = x.exp() - 2.0;
17     let _ = x.exp() - 1.0 * 2.0;
18 }