RE: Floor Decimal Math
- Date: Thu, 15 May 2008 10:32:48 -0500
- From: John Trammell <johnt@xxxxxxxxxxxxxx>
- Subject: RE: Floor Decimal Math
> -----Original Message-----
> From: Adam de Zoete [mailto:adam.dezoete@xxxxxxxxxxxxxx] On Behalf Of
> Adam de Zoete
> Sent: Thursday, May 15, 2008 6:24 AM
> To: mysql@xxxxxxxxxxxxxxx
> 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/mysql?unsub=royale@xxxxxxxxxx