gmp_mul


gmp apg

MULTIPLY two GMP number.





This function returns a GMP number representing the ( $num1 * $num2 ).



<?php

GMP gmp_mul 
( GMP|int|string $num1 , GMP|int|string $num2 )


where,

$num1 = The first factor

$num2 
= The second factor

?>
 

$num1


The first factor, ( multiplicand ).



$num2


The second factor, ( multiplier ).



  1 EXERCISE   

<?php

// This code in PHP 7 produces a Warning
// On PHP 8 - runs smoothly

$a01a = (PHP_INT_MIN + .987654);

$a01b = '256';

$m01ab = gmp_mul($a01a, $a01b);

echo 
'gmp_mul( ' . $a01a .', ' . $a01b . ' ) = ' . $m01ab . '<br><br>'; 

?> 

  2 EXERCISE   

<?php

// This code in PHP 7 produces a Warning
// On PHP 8 - runs smoothly

// With each new run, this exercise 
// gives a different result

$a02a = time();

$a02b = 1.9;

$m02ab = gmp_mul($a02a, $a02b);

echo 
'gmp_mul( ' . $a02a .', ' . $a02b . ' ) = ' . $m02ab . '<br><br>'; 

?>