Get the App
SLTechnology News&Howtos  ›  Development  › 

How to get Random floating Point number by php

Shulou Source: shulou.com Published: 2022-06-03 17:41:27 11月13日 Update

This article mainly introduces php how to obtain random floating point numbers, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

1. The mt_rand () function uses the Mersenne Twister algorithm to generate random integers.

2. The function is a better choice to generate random values, and the speed of returning the result is 4 times faster than that of the rand () function.

If you want a random integer between 10 and 100, inclusive, use mt_rand (10100).

Syntax:

Mt_rand (); ormt_rand (min,max)

The return value is a random integer between min (or 0) and max (or mt_getrandmax ()), including boundary values. If max thanks you for reading this article carefully, I hope the article "how to get random floating points from php" shared by the editor will be helpful to you. At the same time, I also hope you will support us and follow the industry information channel. More related knowledge is waiting for you to learn!

Tags: Articles functions integers points between values interests at the same time examples more friends knowledge algorithms results editing industry grammar information channels boundaries Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Xiaomi Huawei MySQL Shulou Tech Info