25
Note: Similar to Can an integer be NaN in C++?
I understand this has little practical purpose, but can a float or double be set to NaN?
Note: Similar to Can an integer be NaN in C++?
I understand this has little practical purpose, but can a float or double be set to NaN?
Sure! NaN is a static constant in the Float and Double classes.
double x = Double.NaN;