函数名:stats_rand_gen_noncentral_chisquare()
适用版本:PHP 7.4.0及以上版本
函数说明:stats_rand_gen_noncentral_chisquare() 函数用于生成一个非中心卡方分布的随机数。
用法:
float stats_rand_gen_noncentral_chisquare(float $df, float $xnonc)
参数:
返回值:
示例:
$df = 5;
$xnonc = 2;
$randomNumber = stats_rand_gen_noncentral_chisquare($df, $xnonc);
echo "Generated random number from non-central chi-square distribution: " . $randomNumber;
输出:
Generated random number from non-central chi-square distribution: 9.137
注意事项:
extension=stats 来启用该扩展。