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).
Parameters: This function accepts two GMP numbers, $num1, $num2 as mandatory parameters as shown in the above syntax. These parameters can be GMP objects in PHP version 5.6 and later, or we are also allowed to pass numeric strings such that it is possible to convert those strings to numbers.
Return Value: This function returns a GMP number which is the bitwise OR of the GMP numbers passed to it as parameters.
Input : gmp_or("4", "2") Output : 6 Input : gmp_or("9", "10") Output : 11
Below programs illustrate the gmp_or() function in PHP:
Program 1: Program to calculate the bitwise OR of GMP numbers when numeric strings as GMP numbers are passed as arguments.
Program 2: Program to calculate the bitwise OR of GMP numbers when GMP numbers are passed as arguments.
- How to get the function name inside a function in PHP ?
- PHP | Ds\Map put() Function
- PHP | each() Function
- p5.js | hue() function
- PHP | pi( ) Function
- D3.js | d3.max() function
- PHP | exp() Function
- p5.js | pan() Function
- D3.js | d3.map.has() Function
- PHP | Ds\Map xor() Function
- p5.js | red() function
- CSS | hsl() Function
- p5.js | hex() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.