Web lists-archives.com

mysql float data type




HI everyone:
  I have created a table as flowing;

create table t1(c1 float(10,2), c3 decimal(10,2)); 

 insert two records

insert into t1 values(531808.11, 9876543.12);

insert into t1 values(531808.81, 9876543.12);

the result is 

mysql> select * from t1;
+-----------+------------+
| c1        | c3         |
+-----------+------------+
| 531808.12 | 9876543.12 |
| 531808.81 | 9876543.12 |
+-----------+------------+

 Can anyone tell me why 531808.11 has been changed to 531808.12 ?


2014-12-16



I AM AN ORACLE FANS!
Skype:Frank.oracle
Email:xiangdongzou@xxxxxxxxx
Name:东东堂