Generate random float numbers in range PHP

前端 未结 5 1801
夕颜
夕颜 2020-12-18 09:38

I have a code that initializes a dice object by the following code:

public function initializeDiceSides($totalSides, $fair, $maxProbability = 100) {
   $maxT         


        
5条回答
  •  余生分开走
    2020-12-18 10:11

    Make sure the value of $maxProbability and $totalSides are floats.
    If they are integers, the result will be typed as an integer.

提交回复
热议问题