From 23e23bd762a4b5a14ff2abcbabfd2349621a3dbe Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Tue, 22 Mar 2011 17:25:40 -0700 Subject: Further support for floating-point. Literals with exponents work and literals with the 'f32' or 'f64' suffixes work as well. In addition, logging things with the f32 or f64 type works. (float is still assumed to be a synonym for f64). --- src/test/run-pass/float2.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/run-pass/float2.rs (limited to 'src/test') diff --git a/src/test/run-pass/float2.rs b/src/test/run-pass/float2.rs new file mode 100644 index 00000000..0c111ba9 --- /dev/null +++ b/src/test/run-pass/float2.rs @@ -0,0 +1,23 @@ +fn main() { + auto a = 1.5e6; + auto b = 1.5E6; + auto c = 1e6; + auto d = 1E6; + auto e = 3.0f32; + auto f = 5.9f64; + auto g = 1.e6f32; + auto h = 1.0e7f64; + auto i = 1.0E7f64; + auto j = 3.1e+9; + auto k = 3.2e-10; + + check(a == b); + check(c < b); + check(c == d); + check(e < g); + check(f < h); + check(g == 1000000.0f32); + check(h == i); + check(j > k); + check(k < a); +} \ No newline at end of file -- cgit v1.2.3