Java Math.pow() Rounding Error

后端 未结 4 1792
囚心锁ツ
囚心锁ツ 2021-01-25 14:24

I\'m having trouble with (what I suspect is) a rounding error.

I have a string, 0.686357E-01, which I\'m trying to convert to a double. I\'ve been able to s

4条回答
  •  执念已碎
    2021-01-25 14:47

    Double will print always like that, but the value will remain correct. You'll need to format the output to get the correct value. See DecimalFormat class.

提交回复
热议问题