MySQL Forums
Forum List  »  General

Percona MySQL 5.5 and 5.6 IFNULL function changes float data precision
Posted by: james wang
Date: November 23, 2018 03:58AM

Hi All,

My columns, say f1 and f2, type is float (without precision) and normally has 3 or 4 digits after the point stored by application.

if I do:

SELECT IFNULL(f1,f2) AS rate FROM a_table LIMIT 10;

rate would be very different from what in f1 or f2, e.g.
rate f1/f2
0.05400000140070915 0.054
0.008299999870359898 0.0083
10 10
0.004000000189989805 0.004

Is this meant to be like this by design or is it a mis-behalf?

Thanks a lot in advance

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

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.