def float_compare(value1, value2, precision_digits=None, precision_rounding=None):
 rounding_factor = _float_check_precision(precision_digits=precision_digits, precision_rounding=precision_rounding)
 value1 = float_round(value1, precision_rounding=rounding_factor)
 value2 = float_round(value2, precision_rounding=rounding_factor)
 delta = (value1 - value2)
 if float_is_zero(delta, precision_rounding=rounding_factor):
  return 0
 return ((-1) if (delta < 0.0) else 1)

def float_compare ( value1 , value2 , precision_digits = None , precision_rounding = None ) : rounding_factor = _float_check_precision ( precision_digits = precision_digits , precision_rounding = precision_rounding ) value1 = float_round ( value1 , precision_rounding = rounding_factor ) value2 = float_round ( value2 , precision_rounding = rounding_factor ) delta = ( value1 - value2 ) if float_is_zero ( delta , precision_rounding = rounding_factor ) : return 0 return ( ( - 1 ) if ( delta < 0.0 ) else 1 )
compare value1 and value2 after rounding them according to the given precision .