Re: ESL - math.e - rounding

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Wed, 03 Aug 2005 14:53:22 +0200, Juergen Luethje <j.lue at gmx.de>
wrote:

>Both functions sometimes return different results, when the (n+1)th
>decimal place of x equals 5:
>     round_half_even()        -- rounds to nearest even value
>     round_half_up()          -- always rounds up  ( surprise! smile )
>
>What do you all think?

UK VAT law would allow either, or round_half_down.

Another function to consider is knock_on_round(), for example if you
have a column of 100 7.125's, then they should be 7.12, 7.13, 7.12...
so that the sum of the rounded amounts is 712.50, not 712.00.

A clear_knock_on_round function would be an absolute necessity, or a
get/set pair for maximum flexibility.

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu