Because you are using a float.  There has been much discussion of this on
the list, search the archives.  Floats aren't so good if you need your math
to be right.

http://www.mysql.com/doc/en/Column_types.html

> -----Original Message-----
> From: LeTortorec, Jean-Louis [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 03, 2003 1:40 PM
> To: '[EMAIL PROTECTED]'
> Subject: Problem with sum()
>
>
> Hello every one,
>
> I have a simple table, with a "float" field called quantity.
> In this table, there are 2 records: 1 with quantity=0.7, and 1 with
> quantity=0.1.
>
> When I do a "select sum(quantity) from mytable", I got 0.7999998956919
> instead of 0.8.
>
> Does any body know why?
>
> Thanks.
>
> Jean-Louis
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to