Re: [Rd] bug in acosh (win32) (PR#9403)

From: <ripley_at_stats.ox.ac.uk>
Date: Sun 03 Dec 2006 - 14:27:23 GMT


This is a bug in the mingw runtime, and not in R. So the difference is between OSes, not between R versions. Note that

> acosh(2)

[1] 1.316958
> acosh(2+0i)

[1] 0+NaNi
> acosh(2+1e-10i)

[1] 1.316958+0i

so it seems to be happening only for exactly real complex numbers. I think there are also problems with branch cuts.

On Thu, 30 Nov 2006, tshort@eprisolutions.com wrote:

> Full_Name: Tom Short
> Version: 2.4.0
> OS: Windows XP
> Submission from: (NULL) (68.236.159.227)
>
>
> It looks like there's a bug in acosh with complex number in windows:
>
>> acosh(2)
> [1] 1.316958
>> acosh(2+0i)
> [1] 0+NaNi
>
> This happens for me on Windows XP with the following versions:
> R version 2.2.0, 2005-10-06, i386-pc-mingw32
> R version 2.4.0 (2006-10-03) i386-pc-mingw32
>
> It works fine with the following:
> R version 2.4.0 (2006-10-03) i386-pc-linux-gnu (debian)
> R version 2.1.0, 2005-04-18, i386-pc-linux-gnu (debian)
>
>> acosh(2+0i)
> [1] 1.316958+0i
>
> I didn't find any problem with asinh or atanh taking complex numbers. In
> src/main/complex.c, there are some #ifdef Win32's in z_asin and z_acos, so it
> may be related to that.

acosh is unrelated to those.

> - Tom
>
> Tom Short
> EPRI Solutions, Inc.
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon Dec 04 01:38:57 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 04 Dec 2006 - 03:30:56 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.