本文转载自http://blog.youkuaiyun.com/hua_007/article/details/10931035
error C3861: 'round': identifier not found
There is no round function in <cmath> for windows. Instead, you have to implement it yourself. This is rather easy, however:
C++ Syntax (
Toggle Plain Text)
inline double round ( double d ) { return floor ( d + 0.5 ); }
本文介绍了在 C++ 中标准库 <cmath> 缺少 round 函数的情况下,如何自行实现一个简单的 round 函数。该实现基于 floor 函数,并通过添加 0.5 的方式来达到四舍五入的效果。
172

被折叠的 条评论
为什么被折叠?



