| 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 for testing Math.min and Math.max. | 4 // Dart test for testing Math.min and Math.max. |
| 5 | 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
| 6 negate(x) => -x; | 8 negate(x) => -x; |
| 7 | 9 |
| 8 main() { | 10 main() { |
| 9 // Test matrix: | 11 // Test matrix: |
| 10 var minNonZero = 5e-324; | 12 var minNonZero = 5e-324; |
| 11 var maxDenormal = 2.225073858507201e-308; | 13 var maxDenormal = 2.225073858507201e-308; |
| 12 var minNormal = 2.2250738585072014e-308; | 14 var minNormal = 2.2250738585072014e-308; |
| 13 var maxFraction = 0.9999999999999999; | 15 var maxFraction = 0.9999999999999999; |
| 14 var minAbove1 = 1.0000000000000002; | 16 var minAbove1 = 1.0000000000000002; |
| 15 var maxNonInt = 4503599627370495.5; | 17 var maxNonInt = 4503599627370495.5; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 for (int j = 0; j < matrix.length; j++) { | 83 for (int j = 0; j < matrix.length; j++) { |
| 82 var left = matrix[i]; | 84 var left = matrix[i]; |
| 83 var right = matrix[j]; | 85 var right = matrix[j]; |
| 84 if (left is List) { | 86 if (left is List) { |
| 85 check(left, left, 0); | 87 check(left, left, 0); |
| 86 } | 88 } |
| 87 check(left, right, i == j ? 0 : (i < j ? -1 : 1)); | 89 check(left, right, i == j ? 0 : (i < j ? -1 : 1)); |
| 88 } | 90 } |
| 89 } | 91 } |
| 90 } | 92 } |
| OLD | NEW |