The gmp_com() function computes the one’s complement of a GMP number.
Syntax
gmp_com($val)
Parameters
val − The GMP number. It can be GMP object in PHP version 5.6 and later. Can also be numeric strings.
Return
The gmp_com() function returns the one’s complement of a GMP number. The output is itself a GMP number.
Example
The following is an example −
<?php $val = "121"; $a = gmp_com($val); echo $a; ?>
Output
The following is the output −
-122