余弦 90 度的值

Value of cosinus 90 degree

使用java.lang.Math 函数。 有人可以解释为什么 cos(90) = 6.1 的值吗?

    for (int i = 0; i < 91; i++) {
        System.out.println(i  + " = " + cos(toRadians(i)));
    }

输出为:

0 = 1.0
1 = 0.9998476951563913
2 = 0.9993908270190958
...
89 = 0.0174524064372836
90 = 6.123233995736766E-17

请注意指数表示法。输出

90 = 6.123233995736766E-17

不表示6.1的值,而是6.1*10^{-17}的值。

接近 (0)。由于浮点数的精度问题,它不是绝对零。