lib/bcmath.js
function bccomp(left_operand, right_operand, scale) {
    var first, second; //bc_num

    if (typeof(scale) == 'undefined') {
        scale = libbcmath.scale;
    }
    scale   = ((scale < 0) ? 0 : scale);

    first   = libbcmath.bc_init_num();
    second  = libbcmath.bc_init_num();

    first   = libbcmath.bc_str2num(left_operand.toString(), scale);     // note bc_ not php_str2num
    second  = libbcmath.bc_str2num(right_operand.toString(), scale);    // note bc_ not php_str2num

    return libbcmath.bc_compare(first, second, scale);
}
function bccomp(left_operand, right_operand, scale) {
    var first, second; //bc_num

    if (typeof(scale) == 'undefined') {
        scale = libbcmath.scale;
    }
    scale   = ((scale < 0) ? 0 : scale);

    first   = libbcmath.bc_init_num();
    second  = libbcmath.bc_init_num();

    first   = libbcmath.bc_str2num(left_operand.toString(), scale);     // note bc_ not php_str2num
    second  = libbcmath.bc_str2num(right_operand.toString(), scale);    // note bc_ not php_str2num

    return libbcmath.bc_compare(first, second, scale);
}
function bccomp ( left_operand , right_operand , scale ) { var first , second ; //bc_num if ( typeof ( scale ) == 'undefined' ) { scale = libbcmath . scale ; } scale = ( ( scale < 0 ) ? 0 : scale ) ; first = libbcmath . bc_init_num ( ) ; second = libbcmath . bc_init_num ( ) ; first = libbcmath . bc_str2num ( left_operand . toString ( ) , scale ) ; // note bc_ not php_str2num second = libbcmath . bc_str2num ( right_operand . toString ( ) , scale ) ; // note bc_ not php_str2num return libbcmath . bc_compare ( first , second , scale ) ; }
bccomp - Compare two arbitrary precision numers

@param string left_operand       The left operand, as a string
@param string right_operand      The right operand, as a string.
@param int [scale]               The optional parameter is used to set the number of digits after the decimal place in the result. You can also set the global scale for all functions by using bcscale()
@return int                      0: Left/Right are equal, 1 if left > right, -1 otherwise
bccomp - Compare two arbitrary precision numers