numbers - Where to use decimal.ROUND_05UP in Python? -
the decimal
module in python provides option rounding decimal
:
round_05up
what practical uses type of rounding?
the ieee decimal arithmetic spec has it:
the rounding mode round-05up permits arithmetic @ shorter lengths emulated in fixed-precision environment without double rounding. example, multiplication @ precision of 9 can effected carrying out multiplication @ (say) 16 digits using round-05up , rounding required length using desired rounding algorithm.
in other words, if round 1 precision using round_05up
, round shorter precision using other rounding mode, result same if had directly rounded shorter precision.
Comments
Post a Comment