Closed veillette closed 2 years ago
solveQuadraticRootsReal( 0, 0, 0 )
returns null, so the documentation seems to match the behavior. It calls into solveLinearRootsReal
, which has a return null
here: https://github.com/phetsims/dot/blob/d5651b2c7a2f57f068299c5472b47b4797662fb9/js/Utils.js#L376
Gotcha. Nothing to do here. Closing.
Here is the method for solveQuadraticRootsReal
If the discriminant is smaller than zero, it returns an empty array.
The return type is therefore never null. A similar issue jsDoc is present with solveCubicRootsReal. But undefined is not a type so I'm not sure how to indicate an empty array. Also, I'm not sure if we should correct the implementation to match the documentation or vice versa.
Assigning to @jonathanolson.