At 2:30 PM +0100 6/15/01, sean.odonnell@stripped wrote:
>Either code MySql for consistent behaviour,
>or Document Differences in the behaviour on the most
>common platforms in the API Documentation so programmers dont
>get caught off guard. Either solution should make most people happy.
As a response to this discussion the last time we all had a go-round
about it, the documentation for ROUND() does in fact now state that it's
based on the underlying C library, and therefore may vary:
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. If
you need one kind of rounding, you should use a well-defined function
like TRUNCATE() or FLOOR() instead.
>The best solution would seem to be to make mysql behave consistently,
>otherwise it will make it difficult to write platform independant
>or at least thats my tuppence on the matter :)
>From: Cynic [mailto:cynic@stripped]
>Sent: Friday, June 15, 2001 1:46 PM
>To: Pete French; PHolm@stripped; win32@stripped
>Subject: Re: Help us make MySQL even better!
>as replied when this point came up the first time, if C
>runtime behaves differently on different systems, it's not
>a bug in the different C runtimes, but in the coding of the
>MySQL team. Or do you _need_ this behavior in MySQL? Seems
>so, since you defend it very strongly.
>At 13:53 15.6. 2001, Pete French wrote the following:
>>> exists, that sql code with ROUND in it will return different values on
>>> different systems, what makes it a BUG.
>>For the unpteenth billion time - software behaves differently on
>>different systems when you do floating point! This is is *not* a bug
>>in mySQL, its a bug in your programming!
>>Did you just not understand the discussion we had at the time ?
> >-pcf. [exasperated by this point comming up *again*]
Paul DuBois, paul@stripped