Re: ESL - math.e - rounding

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

Pete Lomax wrote:
> 
> 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
> 
> 

What is it (knock_on_round) used for? I mean, if I have a hundred numbers with 3
significant digits then I would add them up *before* rounding them. You wouldn't
want to lose precision before getting your final answer, would you?

Would it take a sequence of numbers and round the odd list elements up and then
the even list elements down?

Are there similar functions in spreadsheets?

=====================================
Too many freaks, not enough circuses.

j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu