What's a java equivalent for std::round(double)?
In cpp file I have std::round(double)
Please can I know the equivalent code in Java
Edit: I am already using java.lang.Math.round(double)
and getting match in 99% cases. But in some places iam ge开发者_StackOverflow社区tting mismatch. For example:
std::round(4816.5058) = 4816
andMath.round(4816.5058) = 4817
std::round(4466.49996) = 4467
andMath.round(4466.49997) = 4466
java.lang.Math.round(double)
精彩评论