| 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 // Dart test program to test arithmetic operations. | 4 // Dart test program to test arithmetic operations. |
| 5 | 5 |
| 6 library arithmetic_test; | 6 library arithmetic_test; |
| 7 import 'dart:math'; | 7 import 'dart:math'; |
| 8 | 8 |
| 9 class ArithmeticTest { | 9 class ArithmeticTest { |
| 10 | 10 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // Smi. | 272 // Smi. |
| 273 Expect.equals(0, (0).round()); | 273 Expect.equals(0, (0).round()); |
| 274 Expect.equals(1, (1).round()); | 274 Expect.equals(1, (1).round()); |
| 275 Expect.equals(-1, (-1).round()); | 275 Expect.equals(-1, (-1).round()); |
| 276 // Big. | 276 // Big. |
| 277 Expect.equals(big, big.round()); | 277 Expect.equals(big, big.round()); |
| 278 Expect.equals(-big, (-big).round()); | 278 Expect.equals(-big, (-big).round()); |
| 279 // Double. | 279 // Double. |
| 280 Expect.equals(3.0, (2.6).round()); | 280 Expect.equals(3.0, (2.6).round()); |
| 281 Expect.equals(-3.0, (-2.6).round()); | 281 Expect.equals(-3.0, (-2.6).round()); |
| 282 Expect.equals(3.0, (2.5).round()); |
| 283 Expect.equals(-3.0, (-2.5).round()); |
| 282 Expect.equals(0.0, (0.0).round()); | 284 Expect.equals(0.0, (0.0).round()); |
| 283 Expect.equals(0.0, (0.1).round()); | 285 Expect.equals(0.0, (0.1).round()); |
| 284 Expect.equals(false, (0.0).round().isNegative); | 286 Expect.equals(false, (0.0).round().isNegative); |
| 285 Expect.equals(false, (0.1).round().isNegative); | 287 Expect.equals(false, (0.1).round().isNegative); |
| 286 Expect.equals(-0.0, (-0.0).round()); | 288 Expect.equals(-0.0, (-0.0).round()); |
| 287 Expect.equals(-0.0, (-0.3).round()); | 289 Expect.equals(-0.0, (-0.3).round()); |
| 288 Expect.equals(2.0, (2.1).round()); | 290 Expect.equals(2.0, (2.1).round()); |
| 289 Expect.equals(-2.0, (-2.1).round()); | 291 Expect.equals(-2.0, (-2.1).round()); |
| 290 Expect.equals(1.0, (0.5).round()); | 292 Expect.equals(1.0, (0.5).round()); |
| 291 Expect.equals(0.0, (0.49999999999999994).round()); | 293 Expect.equals(0.0, (0.49999999999999994).round()); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 runOne(); | 440 runOne(); |
| 439 testSmiDivDeopt(); | 441 testSmiDivDeopt(); |
| 440 testSqrtDeopt(); | 442 testSqrtDeopt(); |
| 441 } | 443 } |
| 442 } | 444 } |
| 443 } | 445 } |
| 444 | 446 |
| 445 main() { | 447 main() { |
| 446 ArithmeticTest.testMain(); | 448 ArithmeticTest.testMain(); |
| 447 } | 449 } |
| OLD | NEW |