diff options
| author | Tim Chevalier <[email protected]> | 2011-03-24 17:12:24 -0700 |
|---|---|---|
| committer | Tim Chevalier <[email protected]> | 2011-03-25 11:20:30 -0700 |
| commit | a47cd50dfb9b8d88abea0baf4122e454d82e09e9 (patch) | |
| tree | 0a6d53f38d5ef5fc32d4cb78ec125606cd2b328e /src/test/run-pass/floatlits.rs | |
| parent | rustc: Store cached crate metadata in the session (diff) | |
| download | rust-a47cd50dfb9b8d88abea0baf4122e454d82e09e9.tar.xz 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/run-pass/floatlits.rs')
| -rw-r--r-- | src/test/run-pass/floatlits.rs | 8 |
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 00000000..db82b486 --- /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 |