[R] surprising difference in log()

From: Fausto Galli <fausto.galli_at_lu.unisi.ch>
Date: Tue, 26 Jun 2007 16:09:52 +0200

Hello everybody

My collegue and I noticed a strange behaviour of R on different platforms. It's a simple computation, but results are rather different.

On Windows XP:

> floor(log(8,2))

[1] 3

which is what one should expect.
Here's instead the result with Mac OS X (same version, 2.5.0 (2007-04-23))

> floor(log(8,2))

[1] 2

Is it a "bug" in R or in the operating system? Anyway, it's quite a surprising one.

Fausto Galli
Institute of Finance
University of Lugano
Via G. Buffi 13
CH-6904 Lugano, Switzerland.
+41 (0)58 666 4497

R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 26 Jun 2007 - 14:15:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Jun 2007 - 03:32:18 GMT.

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