1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/test262/ch11/11.5/11.5.2/S11.5.2_A4_T10.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +// Copyright 2009 the Sputnik authors. All rights reserved. 1.5 +// This code is governed by the BSD license found in the LICENSE file. 1.6 + 1.7 +/** 1.8 + * The result of division is determined by the specification of IEEE 754 arithmetics 1.9 + * 1.10 + * @path ch11/11.5/11.5.2/S11.5.2_A4_T10.js 1.11 + * @description If both operands are finite and nonzero, the quotient is computed and rounded using IEEE 754 round-to-nearest mode. 1.12 + * If the magnitude is too small to represent, the result is then a zero of appropriate sign 1.13 + */ 1.14 + 1.15 +//CHECK#1 1.16 +if (Number.MIN_VALUE / 2.1 !== 0) { 1.17 + $ERROR('#1: Number.MIN_VALUE / 2.1 === 0. Actual: ' + (Number.MIN_VALUE / 2.1)); 1.18 +} 1.19 + 1.20 +//CHECK#2 1.21 +if (Number.MIN_VALUE / -2.1 !== -0) { 1.22 + $ERROR('#2.1: Number.MIN_VALUE / -2.1 === 0. Actual: ' + (Number.MIN_VALUE / -2.1)); 1.23 +} else { 1.24 + if (1 / (Number.MIN_VALUE / -2.1) !== Number.NEGATIVE_INFINITY) { 1.25 + $ERROR('#2.2: Number.MIN_VALUE / -2.1 === -0. Actual: +0'); 1.26 + } 1.27 +} 1.28 + 1.29 +//CHECK#3 1.30 +if (Number.MIN_VALUE / 2.0 !== 0) { 1.31 + $ERROR('#3: Number.MIN_VALUE / 2.0 === 0. Actual: ' + (Number.MIN_VALUE / 2.0)); 1.32 +} 1.33 + 1.34 +//CHECK#4 1.35 +if (Number.MIN_VALUE / -2.0 !== -0) { 1.36 + $ERROR('#4.1: Number.MIN_VALUE / -2.0 === -0. Actual: ' + (Number.MIN_VALUE / -2.0)); 1.37 +} else { 1.38 + if (1 / (Number.MIN_VALUE / -2.0) !== Number.NEGATIVE_INFINITY) { 1.39 + $ERROR('#4.2: Number.MIN_VALUE / -2.0 === -0. Actual: +0'); 1.40 + } 1.41 +} 1.42 + 1.43 +//CHECK#5 1.44 +if (Number.MIN_VALUE / 1.9 !== Number.MIN_VALUE) { 1.45 + $ERROR('#5: Number.MIN_VALUE / 1.9 === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE / 1.9)); 1.46 +} 1.47 + 1.48 +//CHECK#6 1.49 +if (Number.MIN_VALUE / -1.9 !== -Number.MIN_VALUE) { 1.50 + $ERROR('#6: Number.MIN_VALUE / -1.9 === -Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE / -1.9)); 1.51 +} 1.52 + 1.53 +//CHECK#7 1.54 +if (Number.MIN_VALUE / 1.1 !== Number.MIN_VALUE) { 1.55 + $ERROR('#7: Number.MIN_VALUE / 1.1 === Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE / 1.1)); 1.56 +} 1.57 + 1.58 +//CHECK#8 1.59 +if (Number.MIN_VALUE / -1.1 !== -Number.MIN_VALUE) { 1.60 + $ERROR('#8: Number.MIN_VALUE / -1.1 === -Number.MIN_VALUE. Actual: ' + (Number.MIN_VALUE / -1.1)); 1.61 +} 1.62 +