OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 assertEquals(-Infinity, Infinity / Math.min(-0, +0)); | 69 assertEquals(-Infinity, Infinity / Math.min(-0, +0)); |
70 assertEquals(-Infinity, Infinity / Math.min(+0, -0)); | 70 assertEquals(-Infinity, Infinity / Math.min(+0, -0)); |
71 assertEquals(-Infinity, Infinity / Math.min(+0, -0, 1)); | 71 assertEquals(-Infinity, Infinity / Math.min(+0, -0, 1)); |
72 assertEquals(-Infinity, Infinity / Math.min(-0, ZERO)); | 72 assertEquals(-Infinity, Infinity / Math.min(-0, ZERO)); |
73 assertEquals(-Infinity, Infinity / Math.min(ZERO, -0)); | 73 assertEquals(-Infinity, Infinity / Math.min(ZERO, -0)); |
74 assertEquals(-Infinity, Infinity / Math.min(ZERO, -0, 1)); | 74 assertEquals(-Infinity, Infinity / Math.min(ZERO, -0, 1)); |
75 assertEquals(-1, Math.min(+0, -0, -1)); | 75 assertEquals(-1, Math.min(+0, -0, -1)); |
76 assertEquals(-1, Math.min(-1, +0, -0)); | 76 assertEquals(-1, Math.min(-1, +0, -0)); |
77 assertEquals(-1, Math.min(+0, -1, -0)); | 77 assertEquals(-1, Math.min(+0, -1, -0)); |
78 assertEquals(-1, Math.min(-0, -1, +0)); | 78 assertEquals(-1, Math.min(-0, -1, +0)); |
79 assertNaN(Math.min('oxen')); | 79 assertEquals(NaN, Math.min('oxen')); |
80 assertNaN(Math.min('oxen', 1)); | 80 assertEquals(NaN, Math.min('oxen', 1)); |
81 assertNaN(Math.min(1, 'oxen')); | 81 assertEquals(NaN, Math.min(1, 'oxen')); |
82 | 82 |
83 | 83 |
84 // Test Math.max(). | 84 // Test Math.max(). |
85 | 85 |
86 assertEquals(Number.NEGATIVE_INFINITY, Math.max()); | 86 assertEquals(Number.NEGATIVE_INFINITY, Math.max()); |
87 assertEquals(1, Math.max(1)); | 87 assertEquals(1, Math.max(1)); |
88 assertEquals(2, Math.max(1, 2)); | 88 assertEquals(2, Math.max(1, 2)); |
89 assertEquals(2, Math.max(2, 1)); | 89 assertEquals(2, Math.max(2, 1)); |
90 assertEquals(3, Math.max(1, 2, 3)); | 90 assertEquals(3, Math.max(1, 2, 3)); |
91 assertEquals(3, Math.max(3, 2, 1)); | 91 assertEquals(3, Math.max(3, 2, 1)); |
(...skipping 10 matching lines...) Expand all Loading... |
102 assertEquals(Infinity, Infinity / Math.max(-0, +0)); | 102 assertEquals(Infinity, Infinity / Math.max(-0, +0)); |
103 assertEquals(Infinity, Infinity / Math.max(+0, -0)); | 103 assertEquals(Infinity, Infinity / Math.max(+0, -0)); |
104 assertEquals(Infinity, Infinity / Math.max(+0, -0, -1)); | 104 assertEquals(Infinity, Infinity / Math.max(+0, -0, -1)); |
105 assertEquals(Infinity, Infinity / Math.max(-0, ZERO)); | 105 assertEquals(Infinity, Infinity / Math.max(-0, ZERO)); |
106 assertEquals(Infinity, Infinity / Math.max(ZERO, -0)); | 106 assertEquals(Infinity, Infinity / Math.max(ZERO, -0)); |
107 assertEquals(Infinity, Infinity / Math.max(ZERO, -0, -1)); | 107 assertEquals(Infinity, Infinity / Math.max(ZERO, -0, -1)); |
108 assertEquals(1, Math.max(+0, -0, +1)); | 108 assertEquals(1, Math.max(+0, -0, +1)); |
109 assertEquals(1, Math.max(+1, +0, -0)); | 109 assertEquals(1, Math.max(+1, +0, -0)); |
110 assertEquals(1, Math.max(+0, +1, -0)); | 110 assertEquals(1, Math.max(+0, +1, -0)); |
111 assertEquals(1, Math.max(-0, +1, +0)); | 111 assertEquals(1, Math.max(-0, +1, +0)); |
112 assertNaN(Math.max('oxen')); | 112 assertEquals(NaN, Math.max('oxen')); |
113 assertNaN(Math.max('oxen', 1)); | 113 assertEquals(NaN, Math.max('oxen', 1)); |
114 assertNaN(Math.max(1, 'oxen')); | 114 assertEquals(NaN, Math.max(1, 'oxen')); |
115 | 115 |
116 assertEquals(Infinity, 1/Math.max(ZERO, -0)); | 116 assertEquals(Infinity, 1/Math.max(ZERO, -0)); |
117 assertEquals(Infinity, 1/Math.max(-0, ZERO)); | 117 assertEquals(Infinity, 1/Math.max(-0, ZERO)); |
OLD | NEW |