add($_y); echo "\$result = \$x+\$y;\r\n"; echo "$result\r\n"; echo $_result->toString(); echo "\r\n\r\n"; $result = bcsub($result,$y); $_result = $_result->subtract($_y); echo "\$result = \$result-\$y;\r\n"; echo "$result\r\n"; echo $_result->toString(); echo "\r\n\r\n"; $result = bcdiv($x,$y); list($_result,) = $_x->divide($_y); echo "\$result = \$x/\$y;\r\n"; echo "$result\r\n"; echo $_result->toString(); echo "\r\n\r\n"; $result = bcmod($y,$z); list(,$_result) = $_y->divide($_z); echo "\$result = \$x%\$y;\r\n"; echo "$result\r\n"; echo $_result->toString(); echo "\r\n\r\n"; $result = bcmul($x,$z); $_result = $_x->multiply($_z); echo "\$result = \$x*\$z;\r\n"; echo "$result\r\n"; echo $_result->toString(); echo "\r\n\r\n"; $result = bcpowmod($x,$y,$result); $_result = $_x->modPow($_y,$_result); echo "\$result = (\$x**\$y)%\$result;\r\n"; echo "$result\r\n"; echo $_result->toString(); echo "\r\n\r\n"; // modInverse isn't demo'd because no equivalent to it exists in BCMath. ?>