In Javadoc it was written that :
public static String toString(double d)
Returns a string representation of the double argument. All characters mentioned below are ASCII characters.
If the argument is NaN, the result is the string "NaN".
But when I am compiling below code it is giving error: Cant find symbol NaN
String intStr2 =Double.toString(NaN);
Since NaN is not defined, it throws a compilation error, use the following to overcome the same,
String intStr2 = Double.toString(Double.NaN);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With