php man page for gmp_init

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 number

SYNOPSIS
GMP gmp_init (mixed $number, [int $base])
DESCRIPTION
Creates a GMP number from an integer or string.
PARAMETERS
o $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 VALUES
A 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. | | | | +--------+---------------------------------------------------+
NOTES
Note To use the extended base introduced in PHP 5.3.2, then PHP must be compiled against GMP 4.2.0 or greater.
EXAMPLES
Example #1 Creating GMP number <?php $a = gmp_init(123456); $b = gmp_init("0xFFFFDEBACDFEDF7200"); ?>
NOTES
Note 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_q(3) - php
gmp_random(3) - php
gmp_setbit(3) - php
xslt_set_base(3) - php
Similar Topics in the Unix Linux Community
Convert hexadecimal to decimal base
GMP multi precision math library
Andy's PHP Knowledgebase 0.9 (Default branch)
Library linking with GMP
[Solved] Decoding a base 64 string