PHP » PYTHON |
login |
register |
about
|
As per example:
print cmp(1, 2) print cmp(1.00001, 1) If you want to take strings, like bccomp() in PHP: print cmp(float('1'), float('2')) print cmp(float('1.00001'), float('1')) bccomp(PHP 4, PHP 5) bccomp — Compare two arbitrary precision numbers Description
int bccomp
( string $left_operand
, string $right_operand
[, int $scale
] )
Compares the left_operand to the right_operand and returns the result as an integer. Parameters
Return ValuesReturns 0 if the two operands are equal, 1 if the left_operand is larger than the right_operand , -1 otherwise. ExamplesExample #1 bccomp() example
<?php |
more
Recently updated
more
Most requested
more
Last requests
|