Bug #16177 clipping a float value without a notice?

Submitted: 4 Jan 2006 8:01 Modified: 4 Jan 2006 8:36
Reporter: Carsten Meyer Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.10a (mig. 3.23.XX) OS:Linux (SuSE Linux)
Assigned to: CPU Architecture:Any

[4 Jan 2006 8:01] Carsten Meyer
Description:
I find it a little bit strange, clipping a float value that does not fit into a field without a notice. 

MySQL 3.XX.XX didn't clip such (wrong) values, but after the migration to 4.1.10a values were changed. 

How to repeat:
Example:
create table floattest ( val float (5,2));
insert into floattest (val) values (1000.00);
SELECT * FROM floattest;

Results:
val 999.99

Suggested fix:
What is the option to set this behavior?

And why isn't it metioned in the chapter "Date Types / Float"?
[4 Jan 2006 8:36] Valeriy Kravchuk
Thank you for a problem report. Sorry, but it is not a bug. It is known and documented behaviour of float data type, that can give you different results on different versions, architectures etc. Please, read http://dev.mysql.com/doc/refman/4.1/en/problems-with-float.html for the details.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.