Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: mathematical rounding...

From: alans:cuervo:stanford at: 6-Nov-2001 13:25

> Hi Ryan, > > << Performance was pretty good for what you get, but not as fast as the > functions I > posted. One thing though... > > >> round -5.5 > == -5 > > This appears to be the wrong answer to me, but I am hardly a math scholar. > Could someone please confirm. >> > > Hmmm. I haven't attempted to verify any of Ladislav's functions, but this is > probably a bit of a gray area. I think "round" is a fairly generic term and > may have different meanings in different contexts and programming languages. > E.g. some do statistical rounding. > > This is another one of those times where a definitive set of documented > library functions would be helpful.
There are several accepted methods of rounding. One version for rounding from 0.5 says to round up if the number to the left of the decimal is even, and truncate if it is odd. The purpose (hope) is to randomize the error so any statistics behave better.
> --Gregg > > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes. >
--Alan <[swithenbank--acm--org]>