add two double given wrong result

前端 未结 5 1114
被撕碎了的回忆
被撕碎了的回忆 2021-01-22 10:33

I\'m using the following piece of code and under some mysterious circumstances the result of the addition is not as it\'s supposed to be:

double _west = 9.482935         


        
5条回答
  •  长情又很酷
    2021-01-22 11:14

    double is not completely accurate, try using decimal instead

    The advanteage of using double and float over decimal is performance

提交回复
热议问题