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