开发者

What's a java equivalent for std::round(double)?

开发者 https://www.devze.com 2023-01-19 06:49 出处:网络
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开发

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 and Math.round(4816.5058) = 4817
  • std::round(4466.49996) = 4467 and Math.round(4466.49997) = 4466


java.lang.Math.round(double)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号