Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$title is deprecated in /home/www/dev/work/website/lvesu/class/controller/blog/php.php on line 28

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/php.manual.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
PHP - Manual: mt_getrandmax - 互联网笔记

略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: mt_getrandmax

2025-06-02

mt_getrandmax

(PHP 4, PHP 5, PHP 7, PHP 8)

mt_getrandmax显示随机数的最大可能值

说明

mt_getrandmax(): int

返回调用 mt_rand() 所能返回的最大的随机数。

参数

此函数没有参数。

返回值

返回不带参数调用 mt_rand() 时获取到的最大随机值,这可用于 max 参数而不是放大结果的最大值(更少的随机)。

参见

  • mt_rand() - 通过梅森旋转(Mersenne Twister)随机数生成器生成随机值
  • mt_srand() - 播下一个更好的随机数发生器种子
  • getrandmax() - 显示随机数最大的可能值
添加备注

用户贡献的备注 1 note

up
25
bishop at php dot net
9 years ago
The upper-bound of this value is platform-independent. PHP implements the 32-bit version of the Mersenne Twister ("mt"), so the maximum possible value is 2**31 - 1 (2147483647).

官方地址:https://www.php.net/manual/en/function.mt-getrandmax.php

冷却塔厂家 广告
中文GPT4.0无需注册 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3