src/js/builtin/TypedArray.js
// as opposed to the ordering in the spec.
as opposed to the ordering in the spec.
as opposed to the ordering in the spec .
function TypedArrayCompare(x, y) {
    assert(typeof x === "number" && typeof y === "number",
           "x and y are not numbers.");
    if (x < y)
        return -1;
    if (x > y)
        return 1;
    if (x === 0 && y === 0)
        return ((1 / x) > 0 ? 1 : 0) - ((1 / y) > 0 ? 1 : 0);
    if (Number_isNaN(x))
        return Number_isNaN(y) ? 0 : 1;
    return Number_isNaN(y) ? -1 : 0;
}
function TypedArrayCompare ( x , y ) { assert ( typeof x === "number" && typeof y === "number" , "x and y are not numbers." ) ; if ( x < y ) return - 1 ; if ( x > y ) return 1 ; if ( x === 0 && y === 0 ) return ( ( 1 / x ) > 0 ? 1 : 0 ) - ( ( 1 / y ) > 0 ? 1 : 0 ) ; if ( Number_isNaN ( x ) ) return Number_isNaN ( y ) ? 0 : 1 ; return Number_isNaN ( y ) ? - 1 : 0 ; }
as opposed to the ordering in the spec.
as opposed to the ordering in the spec .
// Step 1. // Step 2 (Implemented in TypedArraySort). // Step 6. // Step 7. // Steps 8-9. // Steps 3-4. // Steps 5, 10.