Hi,

> Odd numbers round properly at the half (3.5) but even numbers
> don't (4.5).

This sounds like you're misunderstanding an intentional feature. A lot of
applications or system libraries do this to avoid giving 'incorrect' figures
when summing large amounts of rounded numbers.

Here's an example. Take for instance a situation where you are averaging or
summing a large number of rounded figures. If all figures with a 0.5
fractional part are rounded up, then your averages/totals aren't going to be
quite right, producing an upwards skew. When you instead round down even
figures, you get a more accurate total/average.

This behaviour is also described in the manual:

"Note that the behavior of ROUND() when the argument is half way between two
integers depends on the C library implementation. Some round to the nearest
even number, always up, always down, or always towards zero."

So, this isn't a bug. It's MySQL just following the features of your
system's C library.

Regards,

Basil Hussain
---------------------------------------
Internet Developer, Kodak Weddings
E-Mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to