The column type "FLOAT" seems to be flaky in MySQL 2.23.24-beta. I wouldn't mind if it
was a rounding issue but the value 66.66 becomes 66.69 and 77.77 becomes
77.75!
To reproduce the problem follow the steps below:
Step 1: Creat Table
create table TestAmt
(
id int(8) not null auto_increment
, amt_dec decimal(9,2) not null
, amt_float float(9,2) not null
, primary key (id)
)
type=MyISAM
Step 2: Insert values:
insert into TestAmt set amt_dec=11.11,amt_float=11.11
insert into TestAmt set amt_dec=22.22,amt_float=22.22
insert into TestAmt set amt_dec=33.33,amt_float=33.33
insert into TestAmt set amt_dec=44.44,amt_float=44.44
insert into TestAmt set amt_dec=55.55,amt_float=55.55
insert into TestAmt set amt_dec=66.66,amt_float=66.66
insert into TestAmt set amt_dec=77.77,amt_float=77.77
insert into TestAmt set amt_dec=88.88,amt_float=88.88
insert into TestAmt set amt_dec=99.99,amt_float=99.99
Step:3 Look at results:
mysql select * from TestAmt;
++---++
| id | amt_dec | amt_float |
++---++
| 1 | 11.11 | 11.11 |
| 2 | 22.22 | 22.22 |
| 3 | 33.33 | 33.34 |
| 4 | 44.44 | 44.44 |
| 5 | 55.55 | 55.56 |
| 6 | 66.66 | 66.69 |
| 7 | 77.77 | 77.75 |
| 8 | 88.88 | 88.88 |
| 9 | 99.99 | 100.00 |
++---++
9 rows in set (0.00 sec)