Re: round to nearest 500?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ahh.. good call.

http://en.wikipedia.org/wiki/Rounding


Apprently it's called "banker's rounding" or "statistician's rounding" and is a little more complicated than just looking at the odd/even of the digit being arounded.

This is starting to get into some heavy math theory and scary stuff that I'll leave up to people much smarter than me as far as statistical analysis goes.

I'm still suprised nobody's mentioned Superman 3/Office Space in all this.

-TG

= = = Original message = = =

I think there's a fairly good article on it on wikipedia... but it's  
been a while since I read it and I don't have a link for you... sorry.



On Feb 13, 2007, at 12:32 PM, <tg-php@xxxxxxxxxxxxxxxxxxxxxx> <tg- 
php@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> hah yeah, always worth a little skepticism, but it seemed to make  
> some kind of sense.   If you always round up or always round down,  
> that's obviously not right and you end up losing potentially a lot  
> of money or over-estimating the money involved.
>
> Founding up for 5 through 9 and down for 0 through 4 seems like it  
> makes some kind of sense, but apparently it doesn't work out that way.
>
> I'm sure someone out there knows what I'm talking about (it might  
> be the first time, but I know I'm not making this up hah), but  
> rounding 0.75 up to 0.8 and 0.65 down to 0.6 (or vice versa) is  
> supposed to be more accurate or at least leads to fewer anomalies.
>
> Someone feel like writing a quick script that generates random  
> numbers and does the rounding based on these two ideas (doing it  
> the 'hard way') and see how much variation there is after like  
> 10,000 iterations?  If I have time later, I'll do it.  Now I'm even  
> more curious.
>
> -TG
>
> = = = Original message = = =
>
> <snip>
>>  Supposedly this is an accounting trick that
>> ultimatley works out in the end for proper rounding of money
>> values.
>
> Yeah works out for who? Bet it doesn't for the guy paying :P


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux