note 82075 added to function.abs
| From: | estoesunapija at hotmail dot com | Date: | Wed, 26 Mar 2008 22:29:50 +0000 |
| Subject: | note 82075 added to function.abs | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137611@lists.php.net to get a copy of this message | ||
//Not for working with float
//anyways, seems cool for integers
//This works, iff is_int($num)
function nabs ($num=NULL){
$num = (int)$num;
if ($num<=0) return 0; //why bother bit flipping with 0
return ~$num + 1;
}
----
Server IP: 190.2.55.3
Probable Submitter: 201.212.80.234
----
Manual Page -- http://www.php.net/manual/en/function.abs.php
Edit -- https://master.php.net/note/edit/82075
Del: integrated -- https://master.php.net/note/delete/82075/integrated
Del: useless -- https://master.php.net/note/delete/82075/useless
Del: bad code -- https://master.php.net/note/delete/82075/bad+code
Del: spam -- https://master.php.net/note/delete/82075/spam
Del: non-english -- https://master.php.net/note/delete/82075/non-english
Del: in docs -- https://master.php.net/note/delete/82075/in+docs
Del: other reasons-- https://master.php.net/note/delete/82075
Reject -- https://master.php.net/note/reject/82075
Search -- https://master.php.net/manage/user-notes.php