PHP | gmp_mul() Function Last Updated : 14 Jun, 2018 Comments Improve Suggest changes Like Article Like Report The gmp_mul() function in PHP is an inbuilt function which is used to multiply two GMP numbers (GNU Multiple Precision: For large numbers). Syntax: GMP gmp_mul ( GMP $num1, GMP $num2 ) Parameters: This function accepts two GMP numbers. It is mandatory parameters as shown in the above syntax. These can be a GMP object in PHP version 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number. This function multiplies these two numbers and returns it. Return Value: This function returns a GMP number which is multiplication of the two numbers passed as parameter. Examples: Input : num1 = "123456789" num2 = "987654321" Output: 121932631112635269 Input : num1 = "9999999" num2 = "99999" Output: 999989900001 Below programs illustrate the gmp_mul() function in PHP: Program 1: php <?php $mul = gmp_mul("562817", "713645"); echo gmp_strval($mul); ?> Output: 401651537965 Program 2: php <?php $mul = gmp_mul("123456789", "987654321"); echo gmp_strval($mul); ?> Output: Related Articles: PHP | gmp_neg() Function PHP | gmp_clrbit() Function PHP | gmp tag Function 121932631112635269 Reference: http://php.net/manual/en/function.gmp-mul.php Comment More infoAdvertise with us Next Article PHP | gmp_mul() Function M Mithun Kumar Follow Improve Article Tags : Misc Web Technologies PHP PHP-function PHP-gmp +1 More Practice Tags : Misc Similar Reads PHP gmp_lcm() Function The gmp_lcm() is an inbuilt function in PHP that is used to calculate the least common multiple (LCM) of two or more integers. Syntax: gmp_lcm(GMP|int|string $num1, GMP|int|string $num2): GMPParameters: This function accepts two parameters that are described below. $num1: A GMP number resource repre 1 min read PHP | gmp_or() Function The gmp_or() is an inbuilt function in PHP which is used to calculate the bitwise OR of two GMP numbers(GNU Multiple Precision : For large numbers). Syntax: gmp_or($num1, $num2) Parameters: This function accepts two GMP numbers, $num1, $num2 as mandatory parameters as shown in the above syntax. Thes 2 min read PHP | gmp_neg() Function The gmp_neg() function is an in-built function in PHP which returns the negative of a GMP number (GNU Multiple Precision). Syntax : gmp_neg( $num ) Parameters : The function accepts only one mandatory parameter $num which can be either a GMP number resource in PHP 5.5 or a GMP object in PHP version 1 min read PHP | gmp_import() Function The gmp_import() function is an inbuilt function in php which imports a GMP number(GNU Multiple Precision: For large numbers) from a binary string. Syntax: GMP gmp_import ( string $data, int $word_size, int $options ) Parameters: The gmp_import() function accepts three parameters as mentioned above 2 min read PHP | gmp_intval() Function The gmp_intval() is an inbuilt function in PHP which converts a GMP number to an integer. Here GMP refers to GNU Multiple Precision which is for large numbers.Syntax:Â Â int gmp_intval ( $num ) Parameters: The function accepts a single parameter $num which is a GMP number and returns its integer valu 2 min read Like