Android - exact mathematical calculation

前端 未结 4 869
忘了有多久
忘了有多久 2021-01-26 10:26

I have got a Problem, I am developing an Application which should be able to do some mathematic calculations. These calculations have to be exact (or rather not obviously wrong)

4条回答
  •  星月不相逢
    2021-01-26 10:41

    This is a consequence of the IEEE 754 floating point representation, not an error. To deal with it, round your result to an appropriate precision.

提交回复
热议问题