Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ランダムな量(1〜4%)を掛ける必要がある数があります
PHPの用語で、私は考えていました。
$percent = (double) ".0".mt_rand(1,4);
それは.01-.04をもたらすでしょうか?文字列ではなく、数字の形で?
とても素晴らしいのですが、これを行うためのより安全で効率的な方法はありますか?
なぜだけではないのですか$percent = mt_rand(1, 4)/100.0;
$percent = mt_rand(1, 4)/100.0;
javascipt の < を関数 match() と一致させるために競合があります。同じ行コードが wamp では機能しますが、lampp(linux) では機能しないことに注意してください。
with test, I notifie that the problem comes from <?