Javatpoint Logo
Javatpoint Logo

PHP gmp_abs() Function

PHP has a built-in function called gmp_abs() that uses to figure out the absolute value of a GMP number. The function shows the actual value without a numerical symbol if the value is positive or negative. We do not use the positive sign with a number to get the absolute value.

Syntax

The following syntax shows the GMP function.

Parameters

  • As shown in the above syntax, this function takes a GMP number as a parameter.
  • In PHP versions 5.6 and later, it can be a GMP object or a numeric string that can be turned into a number.
  • This function finds this number's absolute value and gives it back.

Return Value:

This function gives a positive GMP number the same as the number passed as a parameter in terms of its actual values.

Examples

The following examples show the absolute or actual value of the GMP parameter.

Example1: the following example shows an absolute function with value.

Output

The following output shows the actual value.

PHP gmp_abs() Function

Example2: the following example shows the absolute function with variable.

Output

The following output shows the actual value.

PHP gmp_abs() Function

Example3: the following example shows the absolute function with the variable. The decimal values and the positive sign do not work on function.

Output

The following output shows the actual value.

PHP gmp_abs() Function

Conclusion

It helps to use the absolute value for the web application. It shows basic numbers using absolute php functions.







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