Loss of precision on adding doubles?

前端 未结 3 712
难免孤独
难免孤独 2021-01-16 00:54

folks! I\'ve encountered a little problem: I\'m doing a simple addition with three double values. The result has a smaller precision than the used values.

d         


        
3条回答
  •  生来不讨喜
    2021-01-16 01:24

    There is no problem. The significant figure of 0.00208333 and 3.12708 are both 6. This is a correct result.

提交回复
热议问题