以下是引用甲级黎庶在2017-10-12 07:48:46的发言:
大佬,round和iround有什么区别啊
iround 是什么,你想说的是lround吧?
上个链接中有说
If the result of lround or llround is outside the range representable by the return type, a domain error or a range error may occur.
这个链接 http://pubs. 说得更详细:
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions. On return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.