Computer >> Computer tutorials >  >> Programming >> PHP

gmp_mod() function in PHP


The gmp_mod() function performs modulo operation between two GMP numbers.

Syntax

gmp_mod(n, d)

Parameters

  • n − A GMP number

  • d − Modulo that is being evaluated

Return

The gmp_mod() function returns a GMP number.

Example

The following is an example −

<?php
   $res = gmp_mod("9", "4");
   echo gmp_strval($res);
?>

Output

The following is the output −

1