hello jorge,
> Need a function that view an generic numerical expression
> of any lenght like:
>
> 0.5 + 1/3 - 3/8 +0.3*1/4
>
> detect the decimal number, convert it for rational number,
> show the convertion of this decimal to rational and
> show the result in a rational number.
the conversion of an input "0.5" to a floating point number is
carried out by the function READLIST (in src/nparse.lisp).
so if you replace READLIST, it changes the way Maxima
handles floating point number input.
you could write another READLIST function which examines
the input to see if it looks like [0-9]*\.[0-9]*
or [0-9]*\.[0-9]*[esd][0-9]* or something like that,
and, if so, convert it into a Maxima rational number or maybe
an expression like ((mtimes) ((mquotient) a b) ((mexpt) 10 c)).
just guessing here.
i think that the exact conversion of floating point input to a
Maxima rational number might be interesting to others as
well. i know there are way too many global flags in Maxima,
but maybe yet another flag floating_input_to_exact_rational
could be useful ....
for what it's worth,
robert dodier