Re: Problems with Floating-Point Comparisons

Sergei Golubchik <[email protected]> Mon, 13 Dec 2004 10:42:13 +0100
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>
Hi!

On Dec 13, J.T. Moore wrote:
> Having run across the problems with float comparisons and having read
> http://dev.mysql.com/doc/mysql/en/Problems_with_float.html
> I consider the problem with floating point comparisons to be a bug in mysql.
> 
> When performing comparisons of floating point numbers, shouldn't mysql
> implicitly round the floating point number to the level of percision
> defined. For example, if a table column is defined as float(4,2), one
> would expect that the stored value would be automatically rounded to 2
> decimal places before evaluating the comparison.

Not a bad idea.

> The problem is trival to work around, but a nuisance and it should be fixed.

Even though the idea itself makes sense, it cannot be done before 5.0 -
as it would definitely change the documented behaviour of a stable
version. We cannot do it.

As for 5.0 - it will close the whole issue by suporting exact numeric
types.

Regards,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <[email protected]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Senior Software Developer
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
       <___/  www.mysql.com

-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]