note 55060 added to function.bcmod
| From: | cristianDOTzuddas | Date: | Sun, 24 Jul 2005 10:45:49 +0000 |
| Subject: | note 55060 added to function.bcmod | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-92373@lists.php.net to get a copy of this message | ||
BC Math is really cool, but has only 10 functions. So we MUST write other BC functions and share the
code.
Here is a simple even/odd number check.
<?
function bc_is_even($int_str) {
if (strlen($int_str)>0) {
if (bcmod($int_str, 2)==='0')
return true;
else
return false;
}
else // error
return 0;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.bcmod.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55060
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55060&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55060&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55060&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55060&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55060&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55060&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55060&report=yes
Search -- http://master.php.net/manage/user-notes.php