I think there is a kind of problem with Ray's proposal. Namely, if someone
writing 0.1r0 (or 1/10) expects that the number would be exactly 1/10.
There is no way in binary floats to do that.
This is a problem in the perception of the effect, not in implementing
something, though.
I agree with Ray that parsing would be relatively easy; between the two of
us we have written at least 2 such programs recently.:)
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Raymond Toy
> Sent: Tuesday, January 15, 2008 3:06 PM
> To: Stavros Macrakis
> Cc: fateman at EECS.Berkeley.EDU; Maxima at math.utexas.edu; van Nek
> Subject: Re: [Maxima] Maxima parser and global parameters
>
> Stavros Macrakis wrote:
> > 2) use exact notation instead of floating notation for your
> numbers, e.g.
> >
> > block([fpprec:100],
> > bfloat( sqrt(1000000000000000000001*10^-21) ) );
> >
> > 3) use eval_string or parse_string:
> >
> > I find (2) the most elegant, but perhaps a little clumsy
> notationally.
> >
> > I wonder if it might be useful to define (e.g.) 1.234x23 ('x' for
> > exact) to mean precisely the rational number 1234*10^(23-3).
> >
> Some time ago, I suggested (in passing) to use 1.234r23 ("r" for
> rational). I think this (either r or x) would be quite easy to
> implement. Of course, printing the numbers wouldn't preserve the "r"
> notation.
>
>
> Ray
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>