How to overcome inaccuracy in Java

后端 未结 3 1998
暗喜
暗喜 2020-12-18 14:10

I came to know about the accuracy issues when I executed the following following program:

public static void main(String args[])
{
    double table[         


        
3条回答
  •  执念已碎
    2020-12-18 14:30

    You have to use BigDecimal instead of double. Unfortunately, StrictMath doesn't support BigDecimal, so you will have to use another library, or your own implementation of sin/cos/tan.

提交回复
热议问题