Remove precision-equivalency tests

Due to specs approximation values, some tests are invalid as the harness
helpers rely on another approximated values as Math.LN2.
This commit is contained in:
Leonardo Balter 2016-06-20 17:44:11 -04:00
parent 91d06f50b5
commit 813bb5166c
No known key found for this signature in database
GPG Key ID: 3151533059133F60
5 changed files with 0 additions and 88 deletions

View File

@ -1,19 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
var prec;
function isEqual(num1, num2)
{
if ((num1 === Infinity)&&(num2 === Infinity))
{
return(true);
}
if ((num1 === -Infinity)&&(num2 === -Infinity))
{
return(true);
}
prec = getPrecision(Math.min(Math.abs(num1), Math.abs(num2)));
return(Math.abs(num1 - num2) <= prec);
//return(num1 === num2);
}

View File

@ -1,11 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
function getPrecision(num) {
//TODO: Create a table of prec's,
// because using Math for testing Math isn't that correct.
var log2num = Math.log(Math.abs(num)) / Math.LN2;
var pernum = Math.ceil(log2num);
return 2 * Math.pow(2, -52 + pernum);
}

View File

@ -1,21 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
If x is +Infinity, Math.atan(x) is an implementation-dependent
approximation to +PI/2
es5id: 15.8.2.4_A4
description: Checking if Math.atan(+Infinity) is an approximation to +PI/2
includes:
- math_precision.js
- math_isequal.js
---*/
// CHECK#1
var x = +Infinity;
if (!isEqual(Math.atan(x),Math.PI/2))
{
$ERROR("#1: '!isEqual(Math.atan(+Infinity), Math.PI/2)'");
}

View File

@ -1,21 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
If x is -Infinity, Math.atan(x) is an implementation-dependent
approximation to -PI/2
es5id: 15.8.2.4_A5
description: Checking if Math.atan(-Infinity) is an approximation to -PI/2
includes:
- math_precision.js
- math_isequal.js
---*/
// CHECK#1
var x = -Infinity;
if (!isEqual(Math.atan(x), -Math.PI/2))
{
$ERROR("#1: '!isEqual(Math.atan(-Infinity), -Math.PI/2)'");
}

View File

@ -1,16 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Number.MIN_VALUE is approximately 5e-324
es5id: 15.7.3.3_A1
description: Checking Number.MIN_VALUE value
includes:
- math_precision.js
- math_isequal.js
---*/
// CHECK#1
if (!isEqual(Number.MIN_VALUE, 5e-324)) {
$ERROR('#1: Number.MIN_VALUE approximately equal to 5e-324');
}