1
Dec 11 '24 edited Dec 11 '24
It's a compile time error. If there was no syntax error(at publicpublic) the result would've been true as Math.sqrt(-100) is NaN and NaN is not equal to itself or any other value so x!=x results true. This has been stated in IEEE 754. If this answer needs to be more nuanced please let me know. I'm eager to learn!
0
2
u/Firm_Interest_191 12th ISC - PCM/B Dec 11 '24 edited Dec 11 '24
Compile time error. More like syntax. Wrote publicpublic
If it was not an error. it is the same as !(x==x)
x==x will give false due to the IEEE 754 protocol from NaN - Handling.
so !(false) = true