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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -