]> git.lizzy.rs Git - rust.git/blob - tests/ui/floating_point_exp.fixed
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / floating_point_exp.fixed
1 // run-rustfix
2 #![warn(clippy::imprecise_flops)]
3
4 fn main() {
5     let x = 2f32;
6     let _ = x.exp_m1();
7     let _ = x.exp_m1() + 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_m1();
14     let _ = x.exp_m1() + 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 }