Code coverage report for fdlibm/fdlibm-util.js

Statements: 100% (18 / 18)      Branches: 100% (0 / 0)      Functions: 100% (4 / 4)      Lines: 100% (18 / 18)      Ignored: none     

All files » fdlibm/ » fdlibm-util.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421     48735 48735   48735     48735     1     28036 28036   28036   28036     1   49623     49623 49623 49623       1   1000       1  
function _DoubleHi(f) {
    // Return the most significant 32 bits of a double float number.
    // This contains the sign, exponent, and 21 bits of the mantissa.
    var buf = new ArrayBuffer(8);
    (new Float64Array(buf))[0] = f;
    // Index 1 if the machine is little-endian.  Use index 0 for big-endian.
    var hi = (new Uint32Array(buf))[1];
 
    // Return as a signed integer
    return hi | 0;
}
 
function _DoubleLo(f) {
    // Return the least significant 32 bits of a double float number.
    // This contains the lower 32 bits of the mantissa.
    var buf = new ArrayBuffer(8);
    (new Float64Array(buf))[0] = f;
    // Index 1 if the machine is little-endian.  Use index 1 for big-endian.
    var lo = (new Uint32Array(buf))[0];
 
    return lo;
}
 
function _ConstructDouble(high, low)
{
    var buf = new ArrayBuffer(8);
    // This following is for a little-endian machine.  For a
    // big-endian machine reverse the indices.
    (new Uint32Array(buf))[1] = high;
    (new Uint32Array(buf))[0] = low;
    return new Float64Array(buf)[0];
}
 
// Relative error
function relerr(actual, expected)
{
    return Math.abs(actual - expected) / expected;
}
 
// Verbose logging level. 0 means no messages.
var verbose = 0;