gmp_random() - gmp库(多精度计算)
gmp_random()
(PHP 4 >= 4.0.4, PHP 5, PHP 7)
Random number
WarningThis function has beenDEPRECATEDas of PHP 7.2.0. Relying on this functionis highly discouraged.
说明
gmp_random([int $limiter= 20]): GMPGenerate a random number. The number will be between 0 and(2 ** n)- 1, where n is the number of bits per limb multiplied by$limiter. If$limiteris negative, negative numbers are generated.
A limb is an internal GMP mechanism. The number of bits in a limb is not static, and can vary from system to system. Generally, the number of bits in a limb is either 32 or 64, but this is not guaranteed.
参数
$limiterThe limiter.
可以是一个 GMP数据resouce,或一个可以转换为数值的字符串。
返回值
A random GMP number.
范例
gmp_random() example
以上例程会输出:
1915834968 8642564075890328087
Warning: Do not use this function. Use gmp_random_bits() or gmp_random_range() instead. The documentation and the code for this function do NOT match, and in any case this function is quite useless.
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!