The gmp_add() is a built-in function in PHP which is used to add two GMP numbers (GNU Multiple Precision : For large numbers).
gmp_add ( $num1, $num2 )
Parameters: This function accepts two GMP numbers as 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 adds these two numbers and returns it.
Return Value: This function returns a GMP number which is sum of the two numbers passed as parameter.
Input : "123456789", "987654321" Output : 1111111110 Input : "5628179032615", "7136454221086" Output : 12764633253701
Below programs illustrate the gmp_add() function in PHP :
Program 1 :
- PHP | gmp_fact() for large factorials
- HTTP headers | Large-Allocation
- How to stream large .mp4 files?
- HTML | Adding Youtube videos
- Adding HTML entities using CSS content
- Adding Angular Material Component to Angular Application
- Adding and Querying the data in MongoDB
- ReactJS | Calculator App ( Adding Functionality )
- How to format numbers by prepending 0 to single-digit numbers?
- How to increment letters like numbers in PHP ?
- PHP 5 vs PHP 7
- PHP | Get PHP configuration information using phpinfo()
- PHP | php.ini File Configuration
- How to import config.php file in a PHP script ?
- Meaning of numbers in “col-md-4”,“ col-xs-1”, “col-lg-2” in Bootstrap
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.