Debian Codegraph @

js/src/tests/test262/language/expressions/multiplication/S11.5.1_A4_T8.js

raw
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: |
6 The result of a floating-point multiplication is governed by the rules of
7 IEEE 754 double-precision arithmetics
8 es5id: 11.5.1_A4_T8
9 description: >
10 Multiplication is not always associative (x * y * z is the same as
11 (x * y) * z, not x * (y * z))
12 ---*/
13
14 //CHECK#1
15 if (Number.MAX_VALUE * 1.1 * 0.9 !== (Number.MAX_VALUE * 1.1) * 0.9) {
16 throw new Test262Error('#1: Number.MAX_VALUE * 1.1 * 0.9 === (Number.MAX_VALUE * 1.1) * 0.9. Actual: ' + (Number.MAX_VALUE * 1.1 * 0.9));
17 }
18
19 //CHECK#2
20 if ((Number.MAX_VALUE * 1.1) * 0.9 === Number.MAX_VALUE * (1.1 * 0.9)) {
21 throw new Test262Error('#2: (Number.MAX_VALUE * 1.1) * 0.9 !== Number.MAX_VALUE * (1.1 * 0.9)');
22 }
23
24 reportCompare(0, 0);