Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
michael@0 | 1 | // Copyright 2009 the Sputnik authors. All rights reserved. |
michael@0 | 2 | // This code is governed by the BSD license found in the LICENSE file. |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * NaN not greater or equal zero |
michael@0 | 6 | * |
michael@0 | 7 | * @path ch08/8.5/S8.5_A5.js |
michael@0 | 8 | * @description Compare NaN with zero |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | var x = NaN; |
michael@0 | 12 | var x_geq_0=(x >= 0.0); |
michael@0 | 13 | var x_leq_0=(x <= 0.0); |
michael@0 | 14 | var x_leq_0_OR_geq_0=(x <= 0.0)||(x >= 0.0); |
michael@0 | 15 | var x_geq_0_ADD_leq_0=(x >= 0.0) + (x <= 0.0); |
michael@0 | 16 | |
michael@0 | 17 | |
michael@0 | 18 | /////////////////////////////////////////////////// |
michael@0 | 19 | // CHECK#1 |
michael@0 | 20 | if (x_geq_0){ |
michael@0 | 21 | $ERROR('#1: NaN not greater or equal zero'); |
michael@0 | 22 | } else { |
michael@0 | 23 | $PRINT('#1: NaN not greater or equal zero'); |
michael@0 | 24 | } |
michael@0 | 25 | // |
michael@0 | 26 | /////////////////////////////////////////////////// |
michael@0 | 27 | |
michael@0 | 28 | /////////////////////////////////////////////////// |
michael@0 | 29 | // CHECK#2 |
michael@0 | 30 | if (x_leq_0){ |
michael@0 | 31 | $ERROR('#2: NaN not less or equal zero'); |
michael@0 | 32 | } else { |
michael@0 | 33 | $PRINT('#2: NaN not less or equal zero'); |
michael@0 | 34 | } |
michael@0 | 35 | // |
michael@0 | 36 | /////////////////////////////////////////////////// |
michael@0 | 37 | |
michael@0 | 38 | /////////////////////////////////////////////////// |
michael@0 | 39 | // CHECK#3 |
michael@0 | 40 | if (x_leq_0_OR_geq_0){ |
michael@0 | 41 | $ERROR('#3: NaN not less or equal zero OR greater or equal zero'); |
michael@0 | 42 | } else { |
michael@0 | 43 | $PRINT('#3: NaN not less or equal zero OR greater or equal zero'); |
michael@0 | 44 | } |
michael@0 | 45 | // |
michael@0 | 46 | /////////////////////////////////////////////////// |
michael@0 | 47 | |
michael@0 | 48 | /////////////////////////////////////////////////// |
michael@0 | 49 | // CHECK#4 |
michael@0 | 50 | if (x_geq_0_ADD_leq_0){ |
michael@0 | 51 | $ERROR('#4: NaN not less or equal zero ADD greater or equal zero'); |
michael@0 | 52 | } else { |
michael@0 | 53 | $PRINT('#4: NaN not less or equal zero ADD greater or equal zero'); |
michael@0 | 54 | } |
michael@0 | 55 | // |
michael@0 | 56 | /////////////////////////////////////////////////// |
michael@0 | 57 |