Loss of precision on adding doubles?

前端 未结 3 714
难免孤独
难免孤独 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:30

    Nothing seems to be wrong with the calculation as what the comments on your post said.

    If you'd like to see more precision consider looking up setprecision()

提交回复
热议问题