R: Strange trig function behavior

后端 未结 5 1289
独厮守ぢ
独厮守ぢ 2021-01-19 05:48

As a Matlab user transitioning to R, I have ran across the problem of applying trigonometric functions to degrees. In Matlab there are trig functions for both radians and de

5条回答
  •  遇见更好的自我
    2021-01-19 06:15

    The same reason that

    1-(1/3)-(1/3)-(1/3)
    

    doesn't equal 0. It has something to do with floating point numbers. I'm sure there will be more elaboration.

提交回复
热议问题