OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // Test basic integer operations. | 4 // Test basic integer operations. |
5 | 5 |
6 main() { | 6 main() { |
7 Expect.equals("NaN", (double.NAN).toString()); | 7 Expect.equals("NaN", (double.NAN).toString()); |
8 Expect.equals("Infinity", (1/0).toString()); | 8 Expect.equals("Infinity", (1/0).toString()); |
9 Expect.equals("-Infinity", (-1/0).toString()); | 9 Expect.equals("-Infinity", (-1/0).toString()); |
10 Expect.equals("0.0", (0.0).toString()); | |
11 Expect.equals("9.0", (9.0).toString()); | |
12 Expect.equals("90.0", (90.0).toString()); | |
13 Expect.equals("90.12", (90.12).toString()); | 10 Expect.equals("90.12", (90.12).toString()); |
14 Expect.equals("0.1", (0.1).toString()); | 11 Expect.equals("0.1", (0.1).toString()); |
15 Expect.equals("0.01", (0.01).toString()); | 12 Expect.equals("0.01", (0.01).toString()); |
16 Expect.equals("0.0123", (0.0123).toString()); | 13 Expect.equals("0.0123", (0.0123).toString()); |
17 Expect.equals("111111111111111110000.0", | |
18 (111111111111111111111.0).toString()); | |
19 Expect.equals("1.1111111111111111e+21", | 14 Expect.equals("1.1111111111111111e+21", |
20 (1111111111111111111111.0).toString()); | 15 (1111111111111111111111.0).toString()); |
21 Expect.equals("1.1111111111111111e+22", | 16 Expect.equals("1.1111111111111111e+22", |
22 (11111111111111111111111.0).toString()); | 17 (11111111111111111111111.0).toString()); |
23 Expect.equals("0.00001", (0.00001).toString()); | 18 Expect.equals("0.00001", (0.00001).toString()); |
24 Expect.equals("0.000001", (0.000001).toString()); | 19 Expect.equals("0.000001", (0.000001).toString()); |
25 Expect.equals("1e-7", (0.0000001).toString()); | 20 Expect.equals("1e-7", (0.0000001).toString()); |
26 Expect.equals("1.2e-7", (0.00000012).toString()); | 21 Expect.equals("1.2e-7", (0.00000012).toString()); |
27 Expect.equals("1.23e-7", (0.000000123).toString()); | 22 Expect.equals("1.23e-7", (0.000000123).toString()); |
28 Expect.equals("1e-8", (0.00000001).toString()); | 23 Expect.equals("1e-8", (0.00000001).toString()); |
29 Expect.equals("1.2e-8", (0.000000012).toString()); | 24 Expect.equals("1.2e-8", (0.000000012).toString()); |
30 Expect.equals("1.23e-8", (0.0000000123).toString()); | 25 Expect.equals("1.23e-8", (0.0000000123).toString()); |
31 | 26 |
32 Expect.equals("-0.0", (-0.0).toString()); | 27 Expect.equals("-0.0", (-0.0).toString()); |
33 Expect.equals("-9.0", (-9.0).toString()); | |
34 Expect.equals("-90.0", (-90.0).toString()); | |
35 Expect.equals("-90.12", (-90.12).toString()); | 28 Expect.equals("-90.12", (-90.12).toString()); |
36 Expect.equals("-0.1", (-0.1).toString()); | 29 Expect.equals("-0.1", (-0.1).toString()); |
37 Expect.equals("-0.01", (-0.01).toString()); | 30 Expect.equals("-0.01", (-0.01).toString()); |
38 Expect.equals("-0.0123", (-0.0123).toString()); | 31 Expect.equals("-0.0123", (-0.0123).toString()); |
39 Expect.equals("-111111111111111110000.0", | |
40 (-111111111111111111111.0).toString()); | |
41 Expect.equals("-1.1111111111111111e+21", | 32 Expect.equals("-1.1111111111111111e+21", |
42 (-1111111111111111111111.0).toString()); | 33 (-1111111111111111111111.0).toString()); |
43 Expect.equals("-1.1111111111111111e+22", | 34 Expect.equals("-1.1111111111111111e+22", |
44 (-11111111111111111111111.0).toString()); | 35 (-11111111111111111111111.0).toString()); |
45 Expect.equals("-0.00001", (-0.00001).toString()); | 36 Expect.equals("-0.00001", (-0.00001).toString()); |
46 Expect.equals("-0.000001", (-0.000001).toString()); | 37 Expect.equals("-0.000001", (-0.000001).toString()); |
47 Expect.equals("-1e-7", (-0.0000001).toString()); | 38 Expect.equals("-1e-7", (-0.0000001).toString()); |
48 Expect.equals("-1.2e-7", (-0.00000012).toString()); | 39 Expect.equals("-1.2e-7", (-0.00000012).toString()); |
49 Expect.equals("-1.23e-7", (-0.000000123).toString()); | 40 Expect.equals("-1.23e-7", (-0.000000123).toString()); |
50 Expect.equals("-1e-8", (-0.00000001).toString()); | 41 Expect.equals("-1e-8", (-0.00000001).toString()); |
51 Expect.equals("-1.2e-8", (-0.000000012).toString()); | 42 Expect.equals("-1.2e-8", (-0.000000012).toString()); |
52 Expect.equals("-1.23e-8", (-0.0000000123).toString()); | 43 Expect.equals("-1.23e-8", (-0.0000000123).toString()); |
53 | 44 |
54 Expect.equals("1000.0", (1000.0).toString()); | |
55 Expect.equals("0.00001", (0.00001).toString()); | 45 Expect.equals("0.00001", (0.00001).toString()); |
56 Expect.equals("1000000000000000100.0", (1000000000000000128.0).toString()); | |
57 Expect.equals("1e+21", (1000000000000000012800.0).toString()); | 46 Expect.equals("1e+21", (1000000000000000012800.0).toString()); |
58 Expect.equals("-1e+21", (-1000000000000000012800.0).toString()); | 47 Expect.equals("-1e+21", (-1000000000000000012800.0).toString()); |
59 Expect.equals("1e-7", (0.0000001).toString()); | 48 Expect.equals("1e-7", (0.0000001).toString()); |
60 Expect.equals("-1e-7", (-0.0000001).toString()); | 49 Expect.equals("-1e-7", (-0.0000001).toString()); |
61 Expect.equals("1.0000000000000001e+21", | 50 Expect.equals("1.0000000000000001e+21", |
62 (1000000000000000128000.0).toString()); | 51 (1000000000000000128000.0).toString()); |
63 Expect.equals("0.000001", (0.000001).toString()); | 52 Expect.equals("0.000001", (0.000001).toString()); |
64 Expect.equals("1e-7", (0.0000001).toString()); | 53 Expect.equals("1e-7", (0.0000001).toString()); |
65 } | 54 } |
OLD | NEW |