> I have a (probably dumb) question.
> My table "temperatura" has two fields described bellow.
>
> <snip>
>
> When I try to select rows with floats, the result is an empty set.

This is not a MySQL problem, nor a database one, but a general computer
science one. It is
almost never save to compare two floating point numbers for equality. The
decimal representation
you see in ASCII is not an exact representation but an approximation.
Because of the
way computers store floating point numbers in bunry and humans read them in
decimal,
the decimal value is alway rounded and there are invisible bits which can
be different
in apparently identical values. For floating point comparisons you should
*always* use
unequalities e.g. "WHERE temp BETWEEN 15.75 AND 15.85".

     Alec Cawley







---------------------------------------------------------------------
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


---------------------------------------------------------------------
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