29 messages in com.mysql.lists.win32Re: BAD BAD BUG: select round(3.5) re...
FromSent OnAttachments
Peter Holm04 Apr 2001 19:12 
David Peoples04 Apr 2001 22:13 
Ralph Mason04 Apr 2001 22:48 
René Tegel04 Apr 2001 23:10 
Sinisa Milivojevic05 Apr 2001 03:55 
David Patte05 Apr 2001 04:05 
Cynic05 Apr 2001 04:17 
Thimble Smith05 Apr 2001 11:26 
Ralph Mason05 Apr 2001 13:00 
Tim Endres05 Apr 2001 13:32 
Pete Harlan05 Apr 2001 19:43 
Jupiter wekwa Punungwe06 Apr 2001 00:08 
Luc Van der Veken06 Apr 2001 01:36 
Jupiter wekwa Punungwe06 Apr 2001 06:49 
Jupiter wekwa Punungwe06 Apr 2001 07:19 
Pete French06 Apr 2001 07:52 
Thimble Smith06 Apr 2001 07:59 
dpa...@relativedata.com06 Apr 2001 08:05 
Pete French06 Apr 2001 08:58 
René Tegel06 Apr 2001 09:17 
Tim Endres06 Apr 2001 09:42 
Pete French06 Apr 2001 10:25 
Tim Endres06 Apr 2001 11:20 
Luc Van der Veken09 Apr 2001 01:55 
Peter Holm11 Apr 2001 09:12 
René Tegel11 Apr 2001 09:31 
René Tegel11 Apr 2001 09:34 
René Tegel12 Apr 2001 11:08 
Luc Van der Veken13 Apr 2001 00:53 
Subject:Re: BAD BAD BUG: select round(3.5) results in 3 !!!
From:Sinisa Milivojevic (sin@beotel.yu)
Date:04/05/2001 03:55:20 AM
List:com.mysql.lists.win32

René Tegel wrote:

reproducable on both NT4 and w2k (same version), however: linux even worse(!), since it rounds 1.5 to 2 and 2.5 to 2! oooooops:)

NT/W2K: mysql> select version(); +---------------+ | version() | +---------------+ | 3.23.32-debug | +---------------+ 1 row in set (0.00 sec)

mysql> select round(1.5), round(2.5); +------------+------------+ | round(1.5) | round(2.5) | +------------+------------+ | 1 | 2 | +------------+------------+ 1 row in set (0.00 sec)

Linux: mysql> select round(1.5), round(2.5); +------------+------------+ | round(1.5) | round(2.5) | +------------+------------+ | 2 | 2 | +------------+------------+ 1 row in set (0.04 sec)

mysql> select version(); +-------------+ | version() | +-------------+ | 3.23.36-log | +-------------+ 1 row in set (0.02 sec)

mysql>

----- Original Message ----- From: "Peter Holm" <PHo@gmx.de> To: <win@lists.mysql.com> Sent: Thursday, April 05, 2001 4:12 AM Subject: BAD BAD BUG: select round(3.5) results in 3 !!!

Hey yu windows guys, are you all sleeping???

Sorry for that bad news:

<LOUD> *** ON WIN32 MYSQL ROUNDS X.5 TO X (and not to X+1) *** </LOUD>

On linux everything works like expected.

Please do understand what this means: round is such a really basic function nobody expects not to work correctly - it means, we even have to test if select 1+1 results 2!

How can this be possible?

Sorry for being so snotty, I had a really bad week trying to understand some errors in my applications testing over and over again and I could not believe it when finding the reason - if you have to use a calculator to validate simple math functions you get snotty at some point...

Ok, we have the source and can check it out ourselves, right? ;)

Anyway, have a nice day

**** Do you sleep at night? (Alien Sex Fiend) **** (select wakeup from bad dream)

Hi!

We shall definitely take a look at the issue.

It could be a bug in OS's math lib, and even if it is so, we might put on our TODO to find a way to circumvent a problem.

Regards,