> -----Original Message-----
> From: Adam de Zoete [mailto:[EMAIL PROTECTED] On Behalf Of
> Adam de Zoete
> Sent: Thursday, May 15, 2008 6:24 AM
> To: mysql@lists.mysql.com
> Subject: Floor Decimal Math
>
> Hi,
>
> I'm running mysql 4.1.20 (Mac OS 10.4.11) and wondering why this ain't
> returning the right answer? Maybe i'm missing something or am i doing
> something wrong?
>
> mysql> select (11.11-FLOOR(11.11))>=0.11;
> +----------------------------+
> | (11.11-FLOOR(11.11))>=0.11 |
> +----------------------------+
> | 0                          |
> +----------------------------+

mysql> set @x = 11.11 - FLOOR(11.11);
Query OK, 0 rows affected (0.00 sec)

mysql> select @x;
+------+
| @x   |
+------+
| 0.11 |
+------+
1 row in set (0.00 sec)

mysql> select @x - 0.11;
+----------------------+
| @x - 0.11            |
+----------------------+
| -5.6898930012039e-16 |
+----------------------+
1 row in set (0.00 sec)

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


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

Reply via email to