Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401]

   1  <?php
   2  
   3  namespace PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions;
   4  
   5  use PhpOffice\PhpSpreadsheet\Calculation\Exception;
   6  use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
   7  use PhpOffice\PhpSpreadsheet\Calculation\Statistical\StatisticalValidations;
   8  
   9  class DistributionValidations extends StatisticalValidations
  10  {
  11      /**
  12       * @param mixed $probability
  13       */
  14      public static function validateProbability($probability): float
  15      {
  16          $probability = self::validateFloat($probability);
  17  
  18          if ($probability < 0.0 || $probability > 1.0) {
  19              throw new Exception(ExcelError::NAN());
  20          }
  21  
  22          return $probability;
  23      }
  24  }