Numbers in a FLOAT or DOUBLE Type Lose Precision (Doc ID 1429713.1)

Last updated on FEBRUARY 23, 2015

Applies to:

MySQL Server - Version 4.0 to 5.5 [Release 4.0 to 5.5]
Information in this document applies to any platform.

Symptoms

A number with more than about 7 digits may lose precision when inserted into a FLOAT field.

A number with more than about 16 digits may lose precision when inserted into a DOUBLE field.
A number with a fractional part may lose precision even if it is just a few digits.
 
For example:
 
CREATE TABLE t (f FLOAT);
INSERT INTO t VALUES (50000001);
SELECT f FROM t;
 
Result: 50000000

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms