GMP::__construct
(PHP 8 >= 8.2.4)
GMP::__construct — Create GMP number
说明
Creates a GMP number from an integer or string.
参数
num
- An integer or a string. The string representation can be decimal, hexadecimal, octal, or binary.
base
-
The base to use for converting a string representation.
An explicit base can be between
2
and62
. For bases up to36
, case is ignored; upper-case and lower-case letters have the same value. For bases37
to62
, upper-case letter represent the values10
to35
and lower-case letter represent the values36
to61
. Ifbase
is0
then the actual base is determined from the leading characters ofnum
. If the first two characters are0x
or0X
, the string is interpreted as a hexadecimal integer. If the first two characters are0b
or0B
, the string is interpreted as a binary integer. If the first two characters are0o
or0o
, the string is interpreted as an octal integer. Moreover, if the first character is0
the string is also interpreted as an octal integer. In all other cases, the string is interpreted as a decimal integer.
参见
- gmp_init() - Create GMP number
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。