PHP.nl

bccomp

bccomp

Compare two arbitrary precision numbers

int **bccomp** string $num1 string $num2  $scale

Compares to and returns the result of the comparison as an integer. num1``num2

Returns if both operands are equal, if is greater than , otherwise. 0``1``num1``num2``-1

Voorbeeld: example

<?php

echo bccomp('1', '2') . "\n";   // -1
echo bccomp('1.00001', '1', 3); // 0
echo bccomp('1.00001', '1', 5); // 1

?>

BcMath\Number::compare