![]() |
The gmp_init() function is an inbuilt function in PHP that is used to create a GMP number from different data types, including strings, integers, or other GMP objects. It’s commonly used when you want to start performing arithmetic operations on large numbers without losing precision. Syntax: gmp_init( int|string $num, int $base = 0 ): GMP
Parameters: This function accepts two parameters that are described below.
Return Value: The gmp_init() function returns a GMP resource that represents the initialized number. Program 1: The following program demonstrates the gmp_init() function. PHP
Output: object(GMP)#1 (1) { Program 2: The following program demonstrates the gmp_init() function. PHP
Output: Hex + Decimal = 123564234 Reference: https://www.php.net/manual/en/function.gmp-init.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |