PHP.nl

bcsub

bcsub

Subtract one arbitrary precision number from another

string **bcsub** string $num1 string $num2  $scale

Subtracts from . num2``num1

The result of the subtraction, as a string.

Voorbeeld: example

<?php

$a = '1.234';
$b = '5';

echo bcsub($a, $b);     // -3
echo bcsub($a, $b, 4);  // -3.7660

?>

bcadd``BcMath\Number::sub