Doc #53523 [NEW]: Missing documentation for edge case of abs() function.

From: Date: Sat, 11 Dec 2010 22:45:20 +0000
Subject: Doc #53523 [NEW]: Missing documentation for edge case of abs() function.
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5653@lists.php.net to get a copy of this message
From: Operating system: GNU/Linux PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:Missing documentation for edge case of abs() function. Description: ------------ --- From manual page: http://www.php.net/function.abs --- Currently return type is described as: "The absolute value of number. If the argument number is of type float, the return type is also float, otherwise it is integer (as float usually has a bigger value range than integer)." and should be something like: "The absolute value of number. If the argument number is of type float, the return type is also float, otherwise it is integer (as float usually has a bigger value range than integer). If the argument is of type integer with value of - PHP_INT_MAX - 1 (minimum signed integer value) the return type is float due to integer overflow...." It's an edge case, but can be source of confusion if type is important. Test script: --------------- $n = - PHP_INT_MAX - 1; var_dump($n); // type - int var_dump(abs($n)); // type - float -- Edit bug report at http://bugs.php.net/bug.php?id=53523&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53523&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53523&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53523&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53523&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53523&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53523&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53523&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53523&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53523&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53523&r=support Expected behavior: http://bugs.php.net/fix.php?id=53523&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53523&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53523&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53523&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53523&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53523&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53523&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53523&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53523&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53523&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53523&r=mysqlcfg

« previous php.doc.bugs (#5653) next »