Fix Issue 5999 - Runtime treats floating NaNs to be equal

Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=5999
Merge pull request #660 from denis-sh/fix-Issue-5999

Fix Issue 5999 - Runtime treats floating NaNs to be equal