function bcsub($a, $b) { return bi_to_str(bi_sub($a, $b)); }
echo 'decimal value of $b = [', bi_to_str($b), "]<br/>\n"; echo 'binary value of $b = [', bi_to_str($b, 2), "]<br/>\n"; /* string bi_base_convert(string $num, int $base_from, int $base_to) Converts string representation of $num from base $base_from to $base_to */ $num = '-12345678900987654321'; echo 'Decimal number [', $num, '] equals to [', bi_base_convert($num, 10, 36), '] by base 36', "<br/>\n"; /* basic functions */ echo '<h3>basic functions</h3>' . "\n"; $c = bi_add($a, $b); echo '$a + $b = [', bi_to_str($c), "]<br/>\n"; $c = bi_sub($a, $b); echo '$a - $b = [', bi_to_str($c), "]<br/>\n"; $c = bi_mul($a, $b); echo '$a * $b = [', bi_to_str($c), "]<br/>\n"; $c = bi_div($a, $b); echo '$a / $b = [', bi_to_str($c), "]<br/>\n"; $c = bi_mod($a, $b); echo '$a % $b = [', bi_to_str($c), "]<br/>\n"; $c = bi_abs($a); echo 'abs($a) = [', bi_to_str($c), "]<br/>\n"; $c = bi_neg($a); echo 'neg($a) = [', bi_to_str($c), "]<br/>\n"; $c = bi_inc($a); echo 'inc($a) = [', bi_to_str($c), "]<br/>\n"; $c = bi_dec($a); echo 'dec($a) = [', bi_to_str($c), "]<br/>\n";