rfc:change_the_edge_case_of_round

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:change_the_edge_case_of_round [2023/11/08 14:59] sakirfc:change_the_edge_case_of_round [2023/11/08 15:38] saki
Line 96: Line 96:
  
 ==== Reference: Databases ==== ==== Reference: Databases ====
 +
 +In most databases, 0.285 and 0.28499999999999998 appear to be distinguishable.
  
 MySQL: MySQL:
Line 105: Line 107:
 |            0.29 | |            0.29 |
 +-----------------+ +-----------------+
 +
 +mysql> SELECT ROUND(0.28499999999999998, 2);
 ++-------------------------------+
 +| ROUND(0.28499999999999998, 2) |
 ++-------------------------------+
 +|                          0.28 |
 ++-------------------------------+
 </code> </code>
  
Line 113: Line 122:
 ------- -------
   0.29   0.29
 +
 +postgres=# SELECT ROUND(0.28499999999999998, 2);
 + round 
 +-------
 +  0.28
 </code> </code>
  
Line 118: Line 132:
 <code> <code>
 sqlite> SELECT ROUND(0.285, 2); sqlite> SELECT ROUND(0.285, 2);
 +0.29
 +
 +sqlite> SELECT ROUND(0.28499999999999998, 2);
 0.29 0.29
 </code> </code>
Line 128: Line 145:
 =====================  ===================== 
                 0.290                  0.290 
 +
 +SQL> SELECT ROUND(0.28499999999999998, 2) FROM RDB$DATABASE;
 +
 +                ROUND 
 +===================== 
 +  0.28000000000000000 
 </code> </code>
  
Line 137: Line 160:
 ----- -----
  .290  .290
 +
 +1> SELECT ROUND(0.28499999999999998, 2);
 +2> go
 +                   
 +-------------------
 + .28000000000000000
 </code> </code>
  
rfc/change_the_edge_case_of_round.txt · Last modified: 2023/12/08 00:37 by saki