zeros.js (723B)
1 // Copyright (C) 2016 The V8 Project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-math.max 6 description: > 7 +0 is considered to be larger than -0 8 info: | 9 Math.max ( value1, value2 , …values ) 10 11 The comparison of values to determine the largest value is done using the 12 Abstract Relational Comparison algorithm except that +0 is considered to be 13 larger than -0. 14 ---*/ 15 16 assert.sameValue(Math.max(0, 0), 0, "(0, 0)"); 17 assert.sameValue(Math.max(-0, -0), -0, "(-0, -0)"); 18 assert.sameValue(Math.max(0, -0), 0, "(0, -0)"); 19 assert.sameValue(Math.max(-0, 0), 0, "(-0, 0)"); 20 assert.sameValue(Math.max(0, 0, -0), 0, "(0, 0, -0)"); 21 22 reportCompare(0, 0);