27 return $b ? self::evaluateGCD($b, $a % $b) : $a;
49 if ($value1 !== null) {
52 $arrayArgs[] = (int) $value;
56 return $e->getMessage();
59 if (count($arrayArgs) <= 0) {
62 $gcd = (int) array_pop($arrayArgs);
64 $gcd = self::evaluateGCD($gcd, (
int) array_pop($arrayArgs));
65 }
while (!empty($arrayArgs));
static validateNumericNullSubstitution($number, $substitute)
Validate numeric, but allow substitute for null.
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
static evaluate(... $args)
GCD.
static evaluateGCD($a, $b)
Recursively determine GCD.
static validateNotNegative($number, ?string $except=null)
Confirm number >= 0.