@@ -95,6 +95,7 @@ public static function extendedGcd(int $a, int $b): array
9595 * @param int $b
9696 *
9797 * @return int
98+ * @psalm-suppress InvalidReturnType (Change to intdiv for PHP 8.0)
9899 */
99100 public static function lcm (int $ a , int $ b ): int
100101 {
@@ -236,7 +237,7 @@ public static function linear(float $a, float $b): ?float
236237 * @param float $c constant coefficient
237238 * @param bool $return_complex Whether to return complex numbers or NANs if imaginary roots
238239 *
239- * @return array{0: float|Complex, 1?: float|Complex}
240+ * @return float[] |Complex[]
240241 * [x₁, x₂] roots of the equation, or
241242 * [NAN, NAN] if discriminant is negative, or
242243 * [Complex, Complex] if discriminant is negative and complex option is on or
@@ -367,7 +368,7 @@ public static function discriminant(float $a, float $b, float $c): float
367368 * @param float $a₀ constant coefficient
368369 * @param bool $return_complex whether to return complex numbers
369370 *
370- * @return array{0: float|Complex, 1?: float|Complex, 2?: float|Complex}
371+ * @return float[] |Complex[]
371372 * array of roots (three real roots, or one real root and two NANs because complex numbers not yet supported)
372373 * (If $a₃ = 0, then only two roots of quadratic equation)
373374 *
@@ -532,8 +533,8 @@ public static function quartic(float $a₄, float $a₃, float $a₂, float $a
532533 // The roots for this polynomial are the roots of the depressed polynomial minus a₃/4.
533534 if (!$ return_complex ) {
534535 /**
535- * FIXME: are the roots real? Single::subtract() works with real numbers only.
536- * @phpstan-ignore-next-line
536+ * @phpstan-ignore-next-line ( Single::subtract() works with real numbers only, must be real roots)
537+ * @psalm-suppress InvalidArgument
537538 */
538539 return Single::subtract ($ depressed_quartic_roots , $ a₃ / 4 );
539540 }
0 commit comments