简介

These functions allow for arbitrary-length integers to be worked with using the GNUMPlibrary.

Most GMP functions accept GMP number arguments. These are shown in this documentation asGMPobjects. However, note that PHP 5.5 and earlier represented GMP numbers asresources. Most of these functions will also accept numeric and string arguments, so long as it is possible to convert the latter to a number. Also, if there is a more performant function that can operate on the arguments(integers only), then it will be used instead(this is done transparently). See also thegmp_init()function.
From PHP 5.6 onwards, thearithmetic,bitwise, andcomparisonoperators may be used with theGMPobjects returned fromgmp_init()and other GMP functions.
Large integers must be specified as strings - otherwise, PHP will coerce them to floats, resulting in a loss of precision.
This extension is available on Windows platforms since PHP 5.1.0.