S15.1.2.2_A3.2_T2.js (1010B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: Operator use ToInt32 6 esid: sec-parseint-string-radix 7 description: ToInt32 use floor 8 ---*/ 9 10 assert.sameValue(parseInt("11", 2.1), parseInt("11", 2), 'parseInt("11", 2.1) must return the same value returned by parseInt("11", 2)'); 11 assert.sameValue(parseInt("11", 2.5), parseInt("11", 2), 'parseInt("11", 2.5) must return the same value returned by parseInt("11", 2)'); 12 assert.sameValue(parseInt("11", 2.9), parseInt("11", 2), 'parseInt("11", 2.9) must return the same value returned by parseInt("11", 2)'); 13 14 assert.sameValue( 15 parseInt("11", 2.000000000001), 16 parseInt("11", 2), 17 'parseInt("11", 2.000000000001) must return the same value returned by parseInt("11", 2)' 18 ); 19 20 assert.sameValue( 21 parseInt("11", 2.999999999999), 22 parseInt("11", 2), 23 'parseInt("11", 2.999999999999) must return the same value returned by parseInt("11", 2)' 24 ); 25 26 reportCompare(0, 0);