Archives

The List

« MySQL Pop Quiz #8 | Main | MySQL DATE_FORMAT() and PHP DATE() Tool »

MySQL Pop Quiz #9

By Carsten | February 29, 2008

This poser comes from Diego Madina.
Using a fairly recent MySQL 5.0 distribution, we see that…

mysql> SELECT 1.1E0, 2.2E0, 3.3E0;
+-------+-------+-------+
| 1.1E0 | 2.2E0 | 3.3E0 |
+-------+-------+-------+
|   1.1 |   2.2 |   3.3 |
+-------+-------+-------+
1 row in set (0.00 sec)

and…

mysql> select 1.1+2.2=3.3;
+-------------+
| 1.1+2.2=3.3 |
+-------------+
|           1 |
+-------------+
1 row in set (0.00 sec)

But…

mysql> select 1.1E0+2.2E0=3.3E0;
+-------------------+
| 1.1E0+2.2E0=3.3E0 |
+-------------------+
|                 0 |
+-------------------+
1 row in set (0.00 sec)

Why?

Click here for the answer


If you have come across something that you think would make a good pop quiz question, send it to carsten (at) bitbybit (dot) dk. It’s OK if you don’t know the answer to your own question — that only makes things more interesting. More Pop Quiz entries.

Topics: MySQL, Pop Quiz |

4 Responses to “MySQL Pop Quiz #9”

  1. Propiedad Privada » Blog Archive » Test rápidos de MySQL - Test 9 Says:
    March 26th, 2008 at 1:26 pm

    [...] Traducido con permiso expreso de Mysql Test Quiz 9 Original [...]

  2. Guerrero de Terracota » MySQL Pop Quiz #9 Says:
    March 31st, 2008 at 9:09 am

    [...] ???????????? ? ?????????? Carsten Pedersen. ???????? [...]

  3. Test rápidos de MySQL - Test 9 • A Estudiar Says:
    April 9th, 2008 at 7:52 am

    [...] Traducido con permiso expreso de Mysql Test Quiz 9 Original [...]

  4. Test rápidos de MySQL - Test 9 • A Estudiar Says:
    April 9th, 2008 at 7:52 am

    [...] Traducido con permiso expreso de Mysql Test Quiz 9 Original [...]

Comments