From maechler at stat.math.ethz.ch  Thu Dec  1 09:36:10 2016
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Thu, 1 Dec 2016 09:36:10 +0100
Subject: [Rd] Different results for cos,sin,tan and cospi,sinpi,tanpi
In-Reply-To: <CAJqeyYZ2jozkWyvpBk9m=zeunh25ciFCfJdBx10ge3hbRUV_cg@mail.gmail.com>
References: <CAJqeyYZ2jozkWyvpBk9m=zeunh25ciFCfJdBx10ge3hbRUV_cg@mail.gmail.com>
Message-ID: <22591.57594.122801.713377@stat.math.ethz.ch>

>>>>> 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>



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