Bug #8435 Precision math: BIGINT arithmetic isn't always correct
| Submitted: | 11 Feb 2005 3:31 | Modified: | 8 Jun 2005 10:18 |
|---|---|---|---|
| Reporter: | Trudy Pelzer | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 5.0.3-alpha-debug | OS: | Linux (SuSE 9.1) |
| Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
[11 Feb 2005 3:31]
Trudy Pelzer
[11 Feb 2005 3:42]
Trudy Pelzer
Sorry: I was in error when I was providing the expected results of the division operation. The correct results should,of course, be BIGINT values. For: mysql> select col1/2 from t1; +---------------------------+ | col1/2 | +---------------------------+ | 4500000000000000000.00000 | | 4500000000000000000.00000 | | 4500000000000000000.00000 | | 4500000000000000000.00000 | +---------------------------+ 6 rows in set (0.00 sec) -- The last 3 results are incorrect. The result should be: +------------------------+ | col1/2 | +------------------------+ | 4500000000000000000 | | 4500000000000000003 | | 4500000000000000028 | | 4500000000000000278 | +------------------------+ And for: mysql> select * from t1; +---------------------+ | col1 | +---------------------+ | 4500000000000000000 | | 4500000000000000000 | | 4500000000000000000 | | 4500000000000000000 | +---------------------+ 6 rows in set (0.00 sec) -- Same problem here, after the UPDATE. The correct result should be: +------------------------+ | col1/2 | ------------------------+ | 4500000000000000000 | | 4500000000000000003 | | 4500000000000000028 | | 4500000000000000278 | +------------------------+
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.041 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.