Re: buggy round()

2002-03-03 Thread BD
Roger, You can always write your own Round() function and have it round exactly the way you want. To round up on a decimal digit 5 use: mysql> select truncate(1.235+0.005,2) rounded; +-+ | rounded | +-+ |1.24 | +-+ 1 row in set (0.00 sec) To round down

RE: buggy round()

2002-03-03 Thread Sommai Fongnamthip
Hi all, ROUND decimal value is the mis-understood between MySQL internal function and another environment/programming. I found that MySQL-Round is correct within the suitable of itself (you can say it correct in C library or other word it correct in technical term), but it did not use

RE: buggy round()

2002-03-03 Thread Roger Baklund
* Gordon > This round discussion has nothing to do with floating point > approximations. well... > Most round routines are statistically biased on the high side. The MySQL > round is statistically correct. The more accurate rounding rule is As far as I can tell, there is no "MySQL round"... as

RE: buggy round()

2002-03-03 Thread Gordon
This round discussion has nothing to do with floating point approximations. Most round routines are statistically biased on the high side. The MySQL round is statistically correct. The more accurate rounding rule is If digit following the column you are rounding is a 5 I

Re: buggy round()

2002-03-01 Thread Shankar Unni
[obfilter: mysql database] Roger Baklund wrote: > * Benjamin Pflugmann >>Think the other way around: If the other option is to have no floating >>point type at all, a "not perfect" one may be good enough for many >>cases. > I agree, to some extent, but a growing number of users are 'normal peo

RE: buggy round()

2002-03-01 Thread Roger Baklund
* Benjamin Pflugmann > On Fri, Mar 01, 2002 at 07:10:10PM +0100, > [EMAIL PROTECTED] wrote: > > ...but as long as 0.55-0.5 != 0.05 I will call it a bug. It may be well > > known and hard to fix, but that does not make the expression right. :) > > Well, IMHO no, a bug is an unexpected flaw. I have

Re: buggy round()

2002-03-01 Thread Benjamin Pflugmann
Hi. On Fri, Mar 01, 2002 at 07:10:10PM +0100, [EMAIL PROTECTED] wrote: [...] > ...but as long as 0.55-0.5 != 0.05 I will call it a bug. It may be well > known and hard to fix, but that does not make the expression right. :) Well, IMHO no, a bug is an unexpected flaw. The imperfection of the flo

RE: buggy round()

2002-03-01 Thread Roger Baklund
* Benjamin Pflugmann [me about round(2.55,1) -> 2.5 or 2.6 on different platforms.] > I would argue whether that is a bug... it is inconsistent on different > platforms, but it is consistent with the behaviour of other programs > on the same platform. You always break the one or the other thing.

Re: buggy round()

2002-03-01 Thread Benjamin Pflugmann
Hi. On Fri, Mar 01, 2002 at 01:14:43PM +0100, [EMAIL PROTECTED] wrote: > Hi, > > there are a couple of bugs related to the round() function. (See the thread > 'Can somebody help me with "round (columna,columnb) "?') > > One bug is already well known and documentet, it is related to different C

buggy round()

2002-03-01 Thread Roger Baklund
Hi, there are a couple of bugs related to the round() function. (See the thread 'Can somebody help me with "round (columna,columnb) "?') One bug is already well known and documentet, it is related to different C library implementations on different platforms: the result of round(2.55,1) may be 2