double.NaN == double.NaN will never be true

Something I came across recently was this oddity:

double.NaN == double.NaN will never be true.

Basically, according to wikipedia, "Not a Number" will never equal anything - not even itself. This is an interesting take on the idea of "nothing" or "unassigned" since null == null returns true. So, as a solution, we have been given double.IsNaN(double)

#FunFact

No comments:

Post a Comment

How I downloaded all my photos from Photobucket

I used to be a photographer. Did I take good pictures? No. Did I like taking pictures? Yes. So I took lots of pictures, but none very good. ...