Manually encodes nan to appease MSVC.