We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
编译以下程序:
得到指令序列如下 (常量表有些问题,不过因为不考量 .s 生成效果,所以还没改):
在 win 和 mac 下输出得到:
在提供的 docker 中得到:
而根据定义 应该得到 nan,也就是说 sign 位是 0
The text was updated successfully, but these errors were encountered:
老实说我还是第一次知道 -nan 的存在。虽然 IEEE754 里 nan 的符号位可以是 1 也可以是 0 ,但是这个符号位本身是没有意义的。它都 not a number 了,还有符号真的好怪,不懂为什么标准库会这么玩。
乘法和输出的实现都没有做特殊判断,直接用的是operator *(double, double)和operator <<(std::ostream&, double)。之后对浮点类型特化一下,加个 isnan 、isinf 特判一下吧。
operator *(double, double)
operator <<(std::ostream&, double)
isnan
isinf
顺带一提,测试用例不包含这样的内容。
Sorry, something went wrong.
No branches or pull requests
编译以下程序:
得到指令序列如下 (常量表有些问题,不过因为不考量 .s 生成效果,所以还没改):
在 win 和 mac 下输出得到:
在提供的 docker 中得到:
而根据定义 应该得到 nan,也就是说 sign 位是 0
The text was updated successfully, but these errors were encountered: