2 #![feature(const_fn_floating_point_arithmetic)]
3 #![warn(clippy::suboptimal_flops)]
5 /// Allow suboptimal_flops in constant context
6 pub const fn const_context() {
8 let _ = x * 180f32 / std::f32::consts::PI;
13 let _ = x.to_degrees();
14 let _ = 90.0_f64.to_degrees();
15 let _ = 90.5_f64.to_degrees();
16 let _ = x.to_radians();
17 let _ = 90.0_f64.to_radians();
18 let _ = 90.5_f64.to_radians();
19 // let _ = 90.5 * 80. * std::f32::consts::PI / 180f32;
20 // Cases where the lint shouldn't be applied
21 let _ = x * 90f32 / std::f32::consts::PI;
22 let _ = x * std::f32::consts::PI / 90f32;
23 let _ = x * 180f32 / std::f32::consts::E;
24 let _ = x * std::f32::consts::E / 180f32;