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 * 180f32 / std::f32::consts::PI;
14 let _ = x * std::f32::consts::PI / 180f32;
15 // Cases where the lint shouldn't be applied
16 let _ = x * 90f32 / std::f32::consts::PI;
17 let _ = x * std::f32::consts::PI / 90f32;
18 let _ = x * 180f32 / std::f32::consts::E;
19 let _ = x * std::f32::consts::E / 180f32;