[Rd] Abnormal behavior of log function (PR#9155)

bayes.gene at gmail.com bayes.gene at gmail.com
Wed Aug 16 17:10:11 CEST 2006


Full_Name: Biao Li
Version: 2.3.1
OS: Mac OS X 10.4.7 (Intel)
Submission from: (NULL) (132.192.4.18)


I installed R 2.3.1 on my MacBook Pro (Tiger 10.4.7) and found strange behavior
of log function:

> a <- 1:20
> log(2^a, 2) == a
 [1]  TRUE  TRUE FALSE  TRUE  TRUE FALSE FALSE  TRUE  TRUE  TRUE  TRUE FALSE
FALSE FALSE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
> a[log(2^a, 2) != a]
 [1]   3  6  7 12 13 14

But on Linux or Windows XP there is no such a problem, and log(2^a, 2) always
equals a.



More information about the R-devel mailing list