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 import "package:expect/expect.dart"; | |
7 | |
8 main() { | 6 main() { |
9 Expect.equals("1e+0", (1.0).toStringAsExponential()); | 7 Expect.equals("1e+0", (1.0).toStringAsExponential()); |
10 Expect.equals("1.1e+1", (11.0).toStringAsExponential()); | 8 Expect.equals("1.1e+1", (11.0).toStringAsExponential()); |
11 Expect.equals("1.12e+2", (112.0).toStringAsExponential()); | 9 Expect.equals("1.12e+2", (112.0).toStringAsExponential()); |
12 Expect.equals("1e+0", (1.0).toStringAsExponential(null)); | 10 Expect.equals("1e+0", (1.0).toStringAsExponential(null)); |
13 Expect.equals("1.1e+1", (11.0).toStringAsExponential(null)); | 11 Expect.equals("1.1e+1", (11.0).toStringAsExponential(null)); |
14 Expect.equals("1.12e+2", (112.0).toStringAsExponential(null)); | 12 Expect.equals("1.12e+2", (112.0).toStringAsExponential(null)); |
15 Expect.equals("1e+0", (1.0).toStringAsExponential(0)); | 13 Expect.equals("1e+0", (1.0).toStringAsExponential(0)); |
16 Expect.equals("1e+1", (11.0).toStringAsExponential(0)); | 14 Expect.equals("1e+1", (11.0).toStringAsExponential(0)); |
17 Expect.equals("1e+2", (112.0).toStringAsExponential(0)); | 15 Expect.equals("1e+2", (112.0).toStringAsExponential(0)); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 Expect.equals("0.00e+0", (0.0).toStringAsExponential(2)); | 89 Expect.equals("0.00e+0", (0.0).toStringAsExponential(2)); |
92 Expect.equals("1e+1", (11.2356).toStringAsExponential(0)); | 90 Expect.equals("1e+1", (11.2356).toStringAsExponential(0)); |
93 Expect.equals("1.1236e+1", (11.2356).toStringAsExponential(4)); | 91 Expect.equals("1.1236e+1", (11.2356).toStringAsExponential(4)); |
94 Expect.equals("1.1236e-4", (0.000112356).toStringAsExponential(4)); | 92 Expect.equals("1.1236e-4", (0.000112356).toStringAsExponential(4)); |
95 Expect.equals("-1.1236e-4", (-0.000112356).toStringAsExponential(4)); | 93 Expect.equals("-1.1236e-4", (-0.000112356).toStringAsExponential(4)); |
96 Expect.equals("1.12356e-4", (0.000112356).toStringAsExponential()); | 94 Expect.equals("1.12356e-4", (0.000112356).toStringAsExponential()); |
97 Expect.equals("-1.12356e-4", (-0.000112356).toStringAsExponential()); | 95 Expect.equals("-1.12356e-4", (-0.000112356).toStringAsExponential()); |
98 Expect.equals("1.12356e-4", (0.000112356).toStringAsExponential(null)); | 96 Expect.equals("1.12356e-4", (0.000112356).toStringAsExponential(null)); |
99 Expect.equals("-1.12356e-4", (-0.000112356).toStringAsExponential(null)); | 97 Expect.equals("-1.12356e-4", (-0.000112356).toStringAsExponential(null)); |
100 } | 98 } |
OLD | NEW |