about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2011-03-24 17:12:24 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2011-03-25 11:20:30 -0700
commita47cd50dfb9b8d88abea0baf4122e454d82e09e9 (patch)
tree0a6d53f38d5ef5fc32d4cb78ec125606cd2b328e /src/test
parente2d6475308481a43facb0e95e9535c5602bf54f2 (diff)
downloadrust-a47cd50dfb9b8d88abea0baf4122e454d82e09e9.tar.gz
rust-a47cd50dfb9b8d88abea0baf4122e454d82e09e9.zip
Parse FP literals without coercing to int. This allows parsing 64-bit
floats. However, if someone writes a literal that can't be represented
precisely in 64 bits, the front-end will accept it while the back-end
will (presumably) complain.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/floatlits.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/run-pass/floatlits.rs b/src/test/run-pass/floatlits.rs
new file mode 100644
index 00000000000..db82b486af0
--- /dev/null
+++ b/src/test/run-pass/floatlits.rs
@@ -0,0 +1,8 @@
+fn main() {
+  auto f = 4.999999999999;
+  check (f > 4.90);
+  check (f < 5.0);
+  auto g = 4.90000000001e-10;
+  check(g > 5e-11);
+  check(g < 5e-9);
+}
\ No newline at end of file