Merge pull request #937 from yxsamliu/nan2

Fix nan for windows
此提交包含在:
Maneesh Gupta authored and GitHub committed 2019-02-28 07:14:27 +05:30
2 父節點 2da14e97f2 278007218a
當前提交 07b0e9574c
1 file changed
+2 -1
+2 -1
查看文件
@@ -918,9 +918,10 @@ double nan(const char* tagp)
return tmp.val;
#else
static_assert(sizeof(uint64_t)==sizeof(double));
uint64_t val = __make_mantissa(tagp);
val |= 0xFFF << 51;
return reinterpret_cast<double>(val);
return *reinterpret_cast<double*>(&val);
#endif
}
__DEVICE__