22declare(strict_types=1);
32 private function __construct(){
41 return $n >= $i ? $i : $i - 1;
49 return $n <= $i ? $i : $i + 1;
59 throw new \InvalidArgumentException(
"Coefficient a cannot be 0!");
61 $discriminant = $b ** 2 - 4 * $a * $c;
62 if($discriminant > 0){
63 $sqrtDiscriminant = sqrt($discriminant);
65 (-$b + $sqrtDiscriminant) / (2 * $a),
66 (-$b - $sqrtDiscriminant) / (2 * $a)
68 }elseif($discriminant == 0){
static solveQuadratic(float $a, float $b, float $c)