about summary refs log tree commit diff
path: root/tests/ui/numbers-arithmetic
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2025-07-13 16:25:27 -0400
committerOneirical <manchot@videotron.ca>2025-08-04 16:43:53 -0400
commit7196d8cd661b875401126a81641d2effc40b3d85 (patch)
tree4e3f314add6e442f40dc9cba83c397a942c01776 /tests/ui/numbers-arithmetic
parent4b596bbd847672da87763b76171687d3544863c2 (diff)
downloadrust-7196d8cd661b875401126a81641d2effc40b3d85.tar.gz
rust-7196d8cd661b875401126a81641d2effc40b3d85.zip
Rehome tests/ui/issues/ tests [3/?]
Diffstat (limited to 'tests/ui/numbers-arithmetic')
-rw-r--r--tests/ui/numbers-arithmetic/f32-literal-rounding-32805.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/numbers-arithmetic/f32-literal-rounding-32805.rs b/tests/ui/numbers-arithmetic/f32-literal-rounding-32805.rs
new file mode 100644
index 00000000000..59efdb9a1aa
--- /dev/null
+++ b/tests/ui/numbers-arithmetic/f32-literal-rounding-32805.rs
@@ -0,0 +1,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);
+}