[R] Bug on r-bc?

Gabor Grothendieck ggrothendieck at gmail.com
Tue Jul 27 06:12:25 CEST 2010


On Mon, Jul 26, 2010 at 6:54 PM, Paul Smith <phhs80 at gmail.com> wrote:
> On Mon, Jul 26, 2010 at 11:42 PM, Gabor Grothendieck
> <ggrothendieck at gmail.com> wrote:
>>> The following code should return 1, but it returns 0:
>>>
>>> source("http://r-bc.googlecode.com/svn/trunk/R/bc.R")
>>> bc("9 % 2")
>>>
>>
>> See FAQ 2 on the r-bc package home page:
>> http://r-bc.googlecode.com
>
> Thanks to all respondents for your replies. It seems that there is
> still a problem:
>
>> bc("2 % 50",sample=0)
> [1] "0"

Its scale=0,  not sample=0

> bc("2 % 50", scale=0)
[1] "2"

> bc("scale=0; 2 % 50")
[1] "2"

> options(bc.scale=0)
> bc("2 % 50")
[1] "2"



More information about the R-help mailing list