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 15:04] sakirfc:change_the_edge_case_of_round [2023/11/08 16:03] saki
Line 96: Line 96:
  
 ==== Reference: Databases ==== ==== Reference: Databases ====
 +
 +In most databases, 0.285 and 0.28499999999999998 appear to be distinguishable.
  
 MySQL: MySQL:
Line 172: Line 174:
 // previous behavior // previous behavior
 var_dump(round(0.285, 2)); // float(0.29) var_dump(round(0.285, 2)); // float(0.29)
 +var_dump(round(0.28499999999999998, 2)); // float(0.29)
  
 // new behavior // new behavior
 var_dump(round(0.285, 2)); // float(0.28) var_dump(round(0.285, 2)); // float(0.28)
 +var_dump(round(0.28499999999999998, 2)); // float(0.28)
 </code> </code>
  
rfc/change_the_edge_case_of_round.txt · Last modified: 2023/12/08 00:37 by saki