+ 2

Why I got NaN

Sometimes I got NaN as output when I enter some random numbers like 5, 4, 6 Code link:- https://replit.com/@Girish-kumarku5/Quadratic-equation-solver?s=app

23rd Jan 2023, 12:07 PM
Girish Sahu
Girish Sahu - avatar
2 odpowiedzi
+ 2
A negative number is produced at line 9 when all 3 inputs are positive numbers Math.sqrt() will return null when a negative number is passed. Null is not a number. btw The link seems to be broken when using the android app.
23rd Jan 2023, 2:56 PM
ODLNT
ODLNT - avatar
+ 1
I fixed the code
23rd Jan 2023, 3:25 PM
Girish Sahu
Girish Sahu - avatar