Bug #79818 truncate funcation bug
Submitted: 1 Jan 2016 8:01 Modified: 1 Jan 2016 14:15
Reporter: Liu David Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.6 OS:Any
Assigned to: CPU Architecture:Any

[1 Jan 2016 8:01] Liu David
Description:
select truncate(9176.05,2) =9176.05
create table demo ( amount double );  select amount,TRUNCATE(amount,2),cast(amount as decimal(38,3)) from demo

=9176.05,9176.04,9176.050

there is a bug for 9176.04.

How to repeat:
select truncate(9176.05,2) =9176.05
create table demo ( amount double );  select amount,TRUNCATE(amount,2),cast(amount as decimal(38,3)) from demo

=9176.05,9176.04,9176.050

there is a bug for 9176.04.
[1 Jan 2016 8:03] Liu David
mac linux

Attachment: mysqltruncate_bug.png (image/png, text), 35.71 KiB.

[1 Jan 2016 14:15] MySQL Verification Team
Thank you for the bug report. Please read:

http://dev.mysql.com/doc/refman/5.7/en/problems-with-float.html