Re: [R] problem with the precision of numbers

2010-01-25 Thread Hans W Borchers
kayj yahoo.com> writes: > > > Hi All, > > thank you all for your help. I have tried Bill's script and it works! so I > am trying to think what was the problem and it looks like it i sthe > precision. so you defined a function of the precision and evaluates at > precision=500. Bill, I was wonder

Re: [R] problem with the precision of numbers

2010-01-25 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of kayj > Sent: Monday, January 25, 2010 8:04 AM > To: r-help@r-project.org > Subject: Re: [R] problem with the precision of numbers > > > Hi All, >

Re: [R] problem with the precision of numbers

2010-01-25 Thread kayj
Hi All, thank you all for your help. I have tried Bill's script and it works! so I am trying to think what was the problem and it looks like it i sthe precision. so you defined a function of the precision and evaluates at precision=500. Bill, I was wondering how did you choose 500? is it arbitrar

Re: [R] problem with the precision of numbers

2010-01-24 Thread Gabor Grothendieck
I have added a FAQ to the r-bc home page which should help address your problems in getting bc to work. On Sun, Jan 24, 2010 at 5:24 PM, kayj wrote: > > Hi All, > > I was wondering if R can deal with high precsion numbers, below is an > example that I tried on using R and Maple where I got differ

Re: [R] problem with the precision of numbers

2010-01-24 Thread Ted Harding
On 25-Jan-10 00:12:29, William Dunlap wrote: >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org] On Behalf Of kayj >> Sent: Sunday, January 24, 2010 2:24 PM >> To: r-help@r-project.org >> Subject: [R] p

Re: [R] problem with the precision of numbers

2010-01-24 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of kayj > Sent: Sunday, January 24, 2010 2:24 PM > To: r-help@r-project.org > Subject: [R] problem with the precision of numbers > > > Hi All, > &

Re: [R] problem with the precision of numbers

2010-01-24 Thread Ted Harding
On 24-Jan-10 22:24:10, kayj wrote: > > Hi All, > > I was wondering if R can deal with high precsion numbers, > below is an example that I tried on using R and Maple where > I got different results. I was not able to use the r-bc > package in R, instead I used the Rmpfr package, below are > both

[R] problem with the precision of numbers

2010-01-24 Thread kayj
Hi All, I was wondering if R can deal with high precsion numbers, below is an example that I tried on using R and Maple where I got different results. I was not able to use the r-bc package in R, instead I used the Rmpfr package, below are both R and Maple results > library(Rmpfr) > > s<-mpfr

Re: [R] problem with the precision of numbers

2010-01-19 Thread Gabor Grothendieck
Maybe bc(..., args = "") or perhaps install a more standard version of bc. See links at http://r-bc.googlecode.com On Tue, Jan 19, 2010 at 5:43 PM, kayj wrote: > > Hi , > > Thanks for your help, I have been trying to use the bc package but I am > getting the following error > > "Error in system(c

Re: [R] problem with the precision of numbers

2010-01-19 Thread kayj
Hi , Thanks for your help, I have been trying to use the bc package but I am getting the following error "Error in system(cmd, input = input, intern = TRUE) : -l not found" any idea?? -- View this message in context: http://n4.nabble.com/problem-with-the-precision-of-numbers-tp1017727p10179

Re: [R] problem with the precision of numbers

2010-01-19 Thread Hans W Borchers
manchester.ac.uk> writes: > [...] > > I suspect this is an invented computation -- the "3456" strikes > me as "unlikely" (it reminds me of my habitual illustrative use > of set.seed(54321)). > > There is a definite problem with the development given by kayj. > When k=2000 and i=k, the formula

Re: [R] problem with the precision of numbers

2010-01-19 Thread Ted Harding
On 19-Jan-10 18:48:47, Gabor Grothendieck wrote: > On Tue, Jan 19, 2010 at 1:41 PM, Ted Harding > wrote: >> On 19-Jan-10 17:55:43, Ben Bolker wrote: >>> kayj yahoo.com> writes: Hi All, I was wodering if it is possible to increase the precision using R. I ran the script below i

Re: [R] problem with the precision of numbers

2010-01-19 Thread Gabor Grothendieck
On Tue, Jan 19, 2010 at 1:41 PM, Ted Harding wrote: > On 19-Jan-10 17:55:43, Ben Bolker wrote: >> kayj yahoo.com> writes: >>> Hi All, >>> >>> I was wodering if it is possible to increase the precision using R. >>> I ran the script below in R and MAPLE and I got different results >>> when k is lar

Re: [R] problem with the precision of numbers

2010-01-19 Thread Ted Harding
On 19-Jan-10 17:55:43, Ben Bolker wrote: > kayj yahoo.com> writes: >> Hi All, >> >> I was wodering if it is possible to increase the precision using R. >> I ran the script below in R and MAPLE and I got different results >> when k is large. >> Any idea how to fix this problem? thanks for your hel

Re: [R] problem with the precision of numbers

2010-01-19 Thread Ben Bolker
kayj yahoo.com> writes: > > > Hi All, > > I was wodering if it is possible to increase the precision using R. I ran > the script below in R and MAPLE and I got different results when k is large. > Any idea how to fix this problem? thanks for your help > > for (k in 0:2000){ > s=0 > for(i in

[R] problem with the precision of numbers

2010-01-19 Thread kayj
Hi All, I was wodering if it is possible to increase the precision using R. I ran the script below in R and MAPLE and I got different results when k is large. Any idea how to fix this problem? thanks for your help for (k in 0:2000){ s=0 for(i in 0:k){ s=s+((-1)^i)*3456*(1+i*1/2000)^3000 } }