Commit Graph

5 Commits

Author SHA1 Message Date
Cedric Snauwaert d4972ffdb6 [FIX] product,float_utils: perform ceiling via float_round with new rounding_method UP
Modified product ceiling() to use float_round() with special mode
for rounding UP (away from zero), avoiding pathological cases where
float representations errors were ceiling to the superior unit.

Also added correspding tests for rounding_method=UP

Fixes issue #1125, and replaces PR #1126.
2014-09-24 17:11:25 +02:00
Olivier Dony 759ccd9845 [IMP] float_utils: simplified code, added float_repr
lp bug: https://launchpad.net/bugs/882036 fixed

bzr revid: odo@openerp.com-20111220234740-kotcgoz3opcbkx4b
2011-12-21 00:47:40 +01:00
Olivier Dony ed53ef4761 [IMP] float_utils: fix HALF_UP rounding according to discussions on bug 882036
Also improved test and added warning logging when
crossing the precision limit due to too many
significant digits. There is apparently a limitation
in Python's float implementation for this.

bzr revid: odo@openerp.com-20111220163420-lz0sh1h0yjkh6jdc
2011-12-20 17:34:20 +01:00
Olivier Dony dcd1c1daff [IMP] float_utils: better variable names, explain /epsilon/ usage
bzr revid: odo@openerp.com-20111219105718-0jbz01rirl0s64ca
2011-12-19 11:57:18 +01:00
Olivier Dony 9ddd05fb3a [REF] float_utils: moved in its own python module
bzr revid: odo@openerp.com-20111216160426-gya8d1d1zymcz8os
2011-12-16 17:04:26 +01:00