about summary refs log tree commit diff
path: root/tests/ui/numbers-arithmetic/f32-literal-rounding-32805.rs
blob: 59efdb9a1aaf3f8ebff1f5b0f21190069287dd3a (plain)
1
2
3
4
5
6
7
8
9
10
11
// https://github.com/rust-lang/rust/issues/32805
//@ run-pass
fn const_mir() -> f32 { 9007199791611905.0 }

fn main() {
    let original = "9007199791611905.0"; // (1<<53)+(1<<29)+1
    let expected = "9007200000000000";

    assert_eq!(const_mir().to_string(), expected);
    assert_eq!(original.parse::<f32>().unwrap().to_string(), expected);
}