rfc:rounding

Differences

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

Link to this comparison view

Next revisionBoth sides next revision
rfc:rounding [2008/08/23 20:43] – created cseilerrfc:rounding [2008/08/24 15:50] – Some typos cseiler
Line 173: Line 173:
 discussion. discussion.
  
-=== Frist version of math.c in CVS ===+=== First version of math.c in CVS ===
  
    * Signature: round($float), rounds to integer, no precision argument    * Signature: round($float), rounds to integer, no precision argument
Line 373: Line 373:
 0.29 if used with %2f as format string. But the problem with fixing printf() is 0.29 if used with %2f as format string. But the problem with fixing printf() is
 portability: Every other language supporting printf() or similar format strings portability: Every other language supporting printf() or similar format strings
-do it wrong in the exact same way, PHP should not deviate from that (in my yes).+do it wrong in the exact same way, PHP should not deviate from that (in my eyes).
 It is always possible to do printf("%.2f", round($float, 2)); if one really It is always possible to do printf("%.2f", round($float, 2)); if one really
 wants correct results, as long as round() works properly. Also, changing the wants correct results, as long as round() works properly. Also, changing the
-printf() bigint algorithm may have adverse effects when debugging floating +printf() bigint algorithm will have adverse effects on the fact that printf 
-point algorithms where a extremely high precision is wanted.+is often used with very high precision (> 20) to debug floating point algorithms.
  
 However, the PHP manual should contain a warning for printf() that rounding may However, the PHP manual should contain a warning for printf() that rounding may
rfc/rounding.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1