[R] Ryacas and fractions with simultaenously very large numerators and denominators
Paul Smith
phhs80 at gmail.com
Thu Nov 23 20:31:22 CET 2006
On 23 Nov 2006 20:17:15 +0100, Peter Dalgaard <p.dalgaard at biostat.ku.dk> wrote:
> > I am doing the following:
> >
> > > x <- yacas("3/2")
> > > for (i in 2:400)
> > + x <- yacas(paste(x,"*",x))
> > > x
> > expression(Inf^1.260864167e+117/Inf^6.304320836e+116)
> > > Eval(x)
> > [1] NaN
> >
> > No luck this way. However, I am successful with
> >
> > > y <- yacas("(3/2)^400")
> > > y
> > expression(7.05507910865533e+190/2.58224987808691e+120)
> > > Eval(y)
> > [1] 2.732144e+70
> >
> > If Ryacas/Yacas cannot multiply fractions with simultaenously very
> > large numerators and denominators, what else should I use?
>
> I don't think they are the same: the latter example has 400 terms, the
> other about 2^400 terms....
Oops, Peter! You are absolutely right. However, my question remains because
> x <- yacas("3/2")
> for (i in 2:2600)
+ x <- yacas(paste("(3/2)*",x))
> x
expression(3.307388556e+261 * Inf^2/(2.404907546e+111 * Inf))
> Eval(x)
[1] NaN
> y <- yacas("(3/2)^2600")
> y
expression(Inf/Inf)
> Eval(y)
[1] NaN
>
Paul
More information about the R-help
mailing list