[R] BUG: atan(1i) / 5 = NaN+Infi ?

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Fri Sep 6 00:12:06 CEST 2024


Perhaps

> Inf*1i
[1] NaN+Infi

clarifies why it is *not* a bug.
(Boy, did that jog some long dusty math memories :-)  )

-- Bert

On Thu, Sep 5, 2024 at 2:48 PM Duncan Murdoch <murdoch.duncan using gmail.com>
wrote:

> On 2024-09-05 4:23 p.m., Leo Mada via R-help wrote:
> > Dear R Users,
> >
> > Is this desired behaviour?
> > I presume it's a bug.
> >
> > atan(1i)
> > # 0+Infi
> >
> > tan(atan(1i))
> > # 0+1i
> >
> > atan(1i) / 5
> > # NaN+Infi
>
> There's no need to involve atan() and tan() in this:
>
>  > (0+Inf*1i)/5
> [1] NaN+Infi
>
> Why do you think this is a bug?
>
> Duncan Murdoch
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list