note 94704 added to ref.math
| From: | michal at roszka dot pl | Date: | Thu, 19 Nov 2009 13:31:19 +0000 |
| Subject: | note 94704 added to ref.math | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163074@lists.php.net to get a copy of this message | ||
An if-less signum function:
<?php
function sgn($n)
{
$n = max($n, -1);
$n = min($n, 1);
return $n;
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 77.252.38.130
----
Manual Page -- http://www.php.net/manual/en/ref.math.php
Edit -- https://master.php.net/note/edit/94704
Del: integrated -- https://master.php.net/note/delete/94704/integrated
Del: useless -- https://master.php.net/note/delete/94704/useless
Del: bad code -- https://master.php.net/note/delete/94704/bad+code
Del: spam -- https://master.php.net/note/delete/94704/spam
Del: non-english -- https://master.php.net/note/delete/94704/non-english
Del: in docs -- https://master.php.net/note/delete/94704/in+docs
Del: other reasons-- https://master.php.net/note/delete/94704
Reject -- https://master.php.net/note/reject/94704
Search -- https://master.php.net/manage/user-notes.php