Special case for float('nan') to ensure that NaN ("not a number") is not validated as a number.