Sorry, there was a typo in algorithm #17:
def roundf(f, prec=0): return round(f + cmp(f, 0.0) * (.1 / pow(10, prec + 2)), prec)
Sorry, there was a typo in algorithm #17:
def roundf(f, prec=0):
return round(f + cmp(f, 0.0) * (.1 / pow(10, prec + 2)), prec)