Bug #10254 Precision math: too-early truncation of post-decimal number

Submitted: 29 Apr 2005 1:24 Modified: 15 Jun 2005 10:07
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.6-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Alexey Botchkov CPU Architecture:Any

[29 Apr 2005 1:24] Peter Gulutzan
Description:
If I divide 2 by 3, and if there are 21 post-decimal digit positions, the possible
answers are 0.666666666666666666666 (truncation) or
0.666666666666666666667 (rounding). But I get 0.666666666666666666000.

How to repeat:
mysql> select 2.00000000 / 3;
+-------------------------+
| 2.00000000 / 3          |
+-------------------------+
| 0.666666666666666666000 |
+-------------------------+
1 row in set (0.00 sec)

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

Page generated in 0.049 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.