Blame view

vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/DistributionValidations.php 664 Bytes
2db47680   hexiaodong   chore: 初始提交 php 遗...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  <?php
  
  namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions;
  
  use PhpOffice\PhpSpreadsheet\Calculation\Exception;
  use PhpOffice\PhpSpreadsheet\Calculation\Functions;
  use PhpOffice\PhpSpreadsheet\Calculation\Statistical\StatisticalValidations;
  
  class DistributionValidations extends StatisticalValidations
  {
      /**
       * @param mixed $probability
       */
      public static function validateProbability($probability): float
      {
          $probability = self::validateFloat($probability);
  
          if ($probability < 0.0 || $probability > 1.0) {
              throw new Exception(Functions::NAN());
          }
  
          return $probability;
      }
  }