lib/types/Float.js
/**
     * The result of converting an IDL float value to an ECMAScript value is the
     * Number value that represents the same numeric value as the IDL float value.
     */
The result of converting an IDL float value to an ECMAScript value is the
Number value that represents the same numeric value as the IDL float value.
The result of converting an IDL float value to an ECMAScript value is the Number value that represents the same numeric value as the IDL float value .
function converter(V) {
        var x, y;
        function isNegative0(x) {
            if (x !== 0) return false;
            var obj = Object.freeze({
                z: -0
            });
            try {
                Object.defineProperty(obj, 'z', {
                    value: x
                });
            } catch (e) {
                return false;
            }
            return true;
        }
        x = Number(V);
        if (isNaN(x) || x === +Infinity || x === -Infinity) {
            throw new TypeError();
        }
        y = new Float32Array(new ArrayBuffer(4));
        y[0] = x;
        if (y[0] === +Infinity || y[0] === -Infinity) {
            throw new TypeError();
        }
        if (y[0] === 0 && !isNegative0(y[0]) && isNegative0(x)) {
            return -0;
        }
        return y[0];
    }
function converter ( V ) { var x , y ; function isNegative0 ( x ) { if ( x !== 0 ) return false ; var obj = Object . freeze ( { z : - 0 } ) ; try { Object . defineProperty ( obj , 'z' , { value : x } ) ; } catch ( e ) { return false ; } return true ; } x = Number ( V ) ; if ( isNaN ( x ) || x === + Infinity || x === - Infinity ) { throw new TypeError ( ) ; } y = new Float32Array ( new ArrayBuffer ( 4 ) ) ; y [ 0 ] = x ; if ( y [ 0 ] === + Infinity || y [ 0 ] === - Infinity ) { throw new TypeError ( ) ; } if ( y [ 0 ] === 0 && ! isNegative0 ( y [ 0 ] ) && isNegative0 ( x ) ) { return - 0 ; } return y [ 0 ] ; }
The result of converting an IDL float value to an ECMAScript value is the
 Number value that represents the same numeric value as the IDL float value.
The result of converting an IDL float value to an ECMAScript value is the Number value that represents the same numeric value as the IDL float value .
//1. Let x be ToNumber(V). //2. If x is NaN, +Infinity or −Infinity, then throw a TypeError. //3. Let S be the set of finite IEEE 754 single-precision floating point //values except −0, but with two special values added: 2^128 and −2^128. //4. Let y be the number in S that is closest to x, selecting the number //with an even significand if there are two equally close values //([ECMA-262], section 8.5). (The two special values 2^128 and −2^128 are //considered to have even significands for this purpose.) //5. If y is 2^128 or −2^128, then throw a TypeError. //6. If y is +0 and x is negative, return −0. //7. Return y.