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;
}
?>