Subject: | bug in float data type |
Name: DBD-mysql
Version: 2.9007
Author: Patrick Galbraith (patg@mysql.com)
Title: DBD-mysql
Abstract: A MySQL driver for the Perl5 Database Interface (DBI)
InstDate: 19:34:06 2005
Location:
http://ppm.ActiveState.com/PPM/ppmserver-5.8-windows.plex?urn:/PPM/Server/SQL
Prerequisites:
1. DBI 0.0
Available Platforms:
1. MSWin32-x86-multi-thread-5.8
Perl version : perl, v5.8.6 built for MSWin32-x86-multi-thread
OS : MS Windows 2000 profesional
I create table as following :
create table test (
floatnum float(13,3)
);
and run some code as following :
$query = qq|
INSERT INTO test (floatnum)
VALUES (1000000.123 )
|;
$sth = $dbh->prepare($query);
$sth->execute();
the result is :
Show quoted text
mysql> select * from test;
+-------------+
| floatnum |
+-------------+
| 1000000.125 |
+-------------+
The result is ok for small value.
The deviation is bigger for bigger number.