These functions allow you to work with arbitrary-length integers using the GNU MP library.
These functions have been added in PHP 4.0.4.
Замечание: Most GMP functions accept GMP number arguments, defined as resource below. However, most of these functions will also accept numeric and string arguments, given that it is possible to convert the latter to a number. Also, if there is a faster function that can operate on integer arguments, it would be used instead of the slower function when the supplied arguments are integers. This is done transparently, so the bottom line is that you can use integers in every function that expects GMP number. See also the gmp_init() function.
Внимание |
If you want to explicitly specify a large integer, specify it as a string. If you don't do that, PHP will interpret the integer-literal first, possibly resulting in loss of precision, even before GMP comes into play. |
Замечание: Для Windows-платформ это расширение недоступно.
You can download the GMP library from http://www.swox.com/gmp/. This site also has the GMP manual available.
You will need GMP version 2 or better to use these functions. Some functions may require more recent version of the GMP library.
In order to have these functions available, you must compile PHP with GMP support by using the --with-gmp option.
Данное расширение не определяет никакие директивы конфигурации в php.ini.
Перечисленные ниже константы определены данным расширением и могут быть доступны только в том случае, если PHP был собран с поддержкой этого расширения или же в том случае, если данное расширение подгружается во время выполнения.
More mathematical functions can be found in the sections BCMath Arbitrary Precision Mathematics Functions and Mathematical Functions.
Пред. | Начало | След. |
textdomain | Уровень выше | gmp_abs |
HIVE: All information for read only. Please respect copyright! |