this would be a change from "fraction mode" or "scientific mode" to more of a "fraction mode by default, real if necessary, either on command".

it would be nice if reduce had a function or command to convert fractions to a real number (such as a variable) without destroying the variable or the current mode. And possibly something where you could set the precision too.

I know about the SCIENTIFIC_NOTATION command, but that changes the mode and destroys the output and variable content's precision. the documentation even warns about it.

If it is a fraction, I would like to keep it a fraction. If it is a real, I would like to keep it as a real.

If I wanted to convert a number from a real to a fraction, I would want to use a function for that. I don't want it to be automatic.

for example if I might use

x=55/10

real(x)

or

toReal(x)

just as I might use imag(x) to get the imaginary part of a complex number.

and similarly,

x:=fraction(0.125)

fractions would stay fractions until it was necessary to convert them to a real. reals would stay reals even when fractions are combined with them.

what do you think?

please bear with me, I am a reduce newbie and I am still learning the syntax.

I don't know what kind of effect this would have on the math. you decide. if you are calculating with real numbers and you have a finite precision, eventually you are going to lose precision due to round-off error.

for instance,

1/2=0.5

0.5/2=0.25

0.25/2=0.125

0.125/2=0.0625

etc., as the number of digits grow and the number of bits required grows with each successive divide.

I suppose this is why you chose to convert reals to fractions. it looks a little awkward, but it keeps the precision, doesn't it? or is it any different than reals really?

the idea behind this change is to preserve the number type where possible, converting where needed.