Skip to content
New issue

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

请问如何使用print打印float或double #12

Closed
masterQian opened this issue Mar 5, 2022 · 5 comments
Closed

请问如何使用print打印float或double #12

masterQian opened this issue Mar 5, 2022 · 5 comments

Comments

@masterQian
Copy link

会爆异常,int是正常的

@AbrasiveBoar902
Copy link

请问你的代码是怎么写的,我实测并没有问题(

@masterQian
Copy link
Author

#include <fast_io.h>
int main(){
print(1.2);
}

就是一句,用的是MSVC编译器,Win32,只有float或double会爆异常。
异常所在文件是intrinsics.h,所在函数是inline constexpr bool add_carry(bool carry,T a,T b,T& out) noexcept;

异常位置位于50行:
else if constexpr(sizeof(T)==4)
return _addcarryx_u32(carry,a,b,reinterpret_caststd::uint32_t*(__builtin_addressof(out)));

异常信息:
0x0020B95D 处有未经处理的异常(在 test.exe 中): 0xC000001D: Illegal Instruction。

@trcrsired
Copy link
Member

不知道什么情况,无法测试出来。

@farteryhr
Copy link

https://en.wikipedia.org/wiki/Intel_ADX cpu太老了没这个指令?

@trcrsired
Copy link
Member

现在已经好了吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants