[Rd] Different results for cos,sin,tan and cospi,sinpi,tanpi

Martin Maechler maechler at stat.math.ethz.ch
Thu Dec 1 09:36:10 CET 2016


>>>>> Ei-ji Nakama <nakama at ki.rim.or.jp>
>>>>>     on Thu, 1 Dec 2016 14:39:55 +0900 writes:

    > Hi,
    > i try sin, cos, and tan.

    >> sapply(c(cos,sin,tan),function(x,y)x(y),1.23e45*pi)
    > [1] 0.5444181 0.8388140 1.5407532

    > However, *pi results the following

    >> sapply(c(cospi,sinpi,tanpi),function(x,y)x(y),1.23e45)
    > [1] 1 0 0

    > Please try whether the following becomes all right.

    [..............................]

Yes, it does  -- the fix will be in all future versions of R.

Thank you very much Ei-ji Nakama, for this valuable contribution
to make R better!

Martin Maechler,
ETH Zurich


    > -- 
    > Best Regards,
    > --
    > Eiji NAKAMA <nakama (a) ki.rim.or.jp>
    > "\u4e2d\u9593\u6804\u6cbb"  <nakama (a) ki.rim.or.jp>



More information about the R-devel mailing list