[Rd] Im() of negative non-complex numbers is pi (PR#8272)

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Tue Nov 1 23:08:16 CET 2005


On Tue, 1 Nov 2005 davison at uchicago.edu wrote:

> Sorry, I meant to write 2.1.1 instead of 2.2.1 below.

OK, but it was changed in 2.1.1 patched so one needs to be precise.

We used to have Arg=Im for such numbers and Arg was wrong, then Im was 
wrong (and now both are correct in 2.2.0 patched).

> On Tue, 1 Nov 2005 davison at uchicago.edu wrote:
>
>> Hi,
>>
>> I think the following indicates a bug in Im().
>>
>>> Im(-1)
>> [1] 3.141592653589793115998
>>> pi
>> [1] 3.141592653589793115998
>>> Im(0i-1)
>> [1] 0
>>> Im(-0.9876)
>> [1] 3.141592653589793115998
>>> Im(-987654321)
>> [1] 3.141592653589793115998
>>> Im(1)
>> [1] 0
>>> is.complex(-1)
>> [1] FALSE
>>
>> This is R 2.2.0; Im(-1) == 0 with R 2.2.1.
>>
>> Thanks,
>>
>> Dan
>>
>>> version
>>          _
>> platform i386-pc-linux-gnu
>> arch     i386
>> os       linux-gnu
>> system   i386, linux-gnu
>> status
>> major    2
>> minor    2.0
>> year     2005
>> month    10
>> day      06
>> svn rev  35749
>> language R
>>
>> Debian (stable) linux
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

-- 
Brian D. Ripley,                  ripley at 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



More information about the R-devel mailing list