gmp_divexact() function in PHP


The gmp_divexact() function checks whether a GMP number is exactly divisible by another GMP number or not.

Syntax

gmp_divexact($n, $divisor)

Parameters

  • n − The number
  • divisor − The divisor value

Return

The gmp_divexact() function returns the result of division.

Example

The following is an example −

<?php
   $n = "20";
   $divisor = "5";
   $res = gmp_divexact($n, $divisor);
   echo $res;
?>

Output

The following is the output −

4

Updated on: 30-Jun-2020

15 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements