Javatpoint Logo
Javatpoint Logo

PHP gmp_add() Function

The addition operation uses in the application without mathematical operators and functionalities. PHP has a built-in function called gmp_add() that uses for the addition of the two figures. Here, we can use positive and negative numbers using a simple function.

Syntax

The following syntax shows the GMP addition's function.

Parameters

  • The above syntax shows that this function uses two GMP numbers as input parameters.
  • This function uses two parameters as a resource and gives the output of the summation function.
  • The GMP function requires two parameters for summation operation. It does not work on more than and less than two values.

Return Value:

This function gives an added value or sum of the two numerical data. It is a numerical value displayed as an output.

Examples

The following examples show the addition of the GMP parameters.

Example1: the following example shows a basic addition function with value. The parameter uses positive data with simple values.

Output

The following output shows the addition of the value.

PHP gmp_add() Function

Example2: the following example shows the summation of positive and negative values with value. The parameter uses one positive value and a second negative value with an additional function.

Output

The following output shows the added value.

PHP gmp_add() Function

Example3: the following example shows a basic addition operation with negative values. The absolute function uses the sum of data to get the actual value.

Output

The following output shows the added value.

PHP gmp_add() Function

Example4: the following example shows a basic addition function with value. The parameter uses variable values for the addition function.

Output

The following output shows the summation value.

PHP gmp_add() Function

Conclusion

The addition function uses to add only two numbers using PHP GMP values. The function removes addition operations using operators and values.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA