Query: gmp_init
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
GMP_INIT(3) 1 GMP_INIT(3) gmp_init - Create GMP numberSYNOPSISGMP gmp_init (mixed $number, [int $base])DESCRIPTIONCreates a GMP number from an integer or string.PARAMETERSo $number - An integer or a string. The string representation can be decimal, hexadecimal or octal. o $base - The base. The base may vary from 2 to 36. If base is 0 (default value), the actual base is determined from the leading charac- ters: if the first two characters are 0x or 0X, hexadecimal is assumed, otherwise if the first character is "0", octal is assumed, otherwise decimal is assumed.RETURN VALUESA GMP number resource in PHP 5.5 and earlier, or a GMP object in PHP 5.6 and later.CHANGELOG+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.2 | | | | | | | The $base was extended from 2 to 36, to 2 to 62 | | | and -2 to -36. | | | | +--------+---------------------------------------------------+NOTESNote To use the extended base introduced in PHP 5.3.2, then PHP must be compiled against GMP 4.2.0 or greater.EXAMPLESExample #1 Creating GMP number <?php $a = gmp_init(123456); $b = gmp_init("0xFFFFDEBACDFEDF7200"); ?>NOTESNote It is not necessary to call this function if you want to use integer or string in place of GMP number in GMP functions, like gmp_add(3). Function arguments are automatically converted to GMP numbers, if such conversion is possible and needed, using the same rules as gmp_init(3). PHP Documentation Group GMP_INIT(3)
Related Man Pages |
---|
gmp_clrbit(3) - php |
gmp_div_qr(3) - php |
gmp_init(3) - php |
gmp_prob_prime(3) - php |
gmp_setbit(3) - php |
Similar Topics in the Unix Linux Community |
---|
Andy's PHP Knowledgebase 0.885 (Default branch) |
Andy's PHP Knowledgebase 0.9 (Default branch) |
Lore 1.7.0 (Default branch) |
Library linking with GMP |
[Solved] Decoding a base 64 string |