rust/tests/ui/unused_rounding.rs

18 lines
348 B
Rust
Raw Normal View History

//@run-rustfix
2022-05-21 16:02:00 -05:00
#![warn(clippy::unused_rounding)]
fn main() {
let _ = 1f32.ceil();
let _ = 1.0f64.floor();
let _ = 1.00f32.round();
2022-05-22 16:21:04 -05:00
let _ = 2e-54f64.floor();
// issue9866
let _ = 3.3_f32.round();
let _ = 3.3_f64.round();
let _ = 3.0_f32.round();
2022-11-30 11:31:38 -06:00
let _ = 3_3.0_0_f32.round();
let _ = 3_3.0_1_f64.round();
2022-05-21 16:02:00 -05:00
}