tan 45 gives me 0.9999

前端 未结 4 667
清酒与你
清酒与你 2021-01-12 08:30

Why does tan 45(0.7853981633974483 in radian) give me 0.9999? What\'s wrong with the following code?

System.out.println(Math.tan(M         


        
4条回答
  •  不知归路
    2021-01-12 08:59

    Use this

    double radians = Math.toRadians(45.0);
    
    System.out.format("The tangent of 45.0 degrees is %.4f%n", Math.tan(radians));
    

提交回复
热议问题