Janos Blazi wrote:
> I have this work sheet (I teach at a high school):
>
> (C1) g : 9.81;
> (D1) 9.810000000000001
> (C2) x(t,v0) := g/2*t^2+v0*t;
> g 2
> (D2) x(t, v0) := - t + v0 t
> 2
> (C3) v(t,v0) := ''(diff(x(t,v0),t));
> (D3) v(t, v0) := v0 + 9.810000000000001 t
> (C4) solve(x(t,0)=50.0,t);
>
> RAT replaced 4.905 by 981//200 = 4.905
> 100 100
> (D4) [t = - -----------, t = -----------]
> 3 SQRT(109) 3 SQRT(109)
>
> I do not understand, why the result is displayed in this strange
> format. After all, g is a floating point number and I should expect
> Maxima to convert all numbers to floating point format.
try set keepfloat:true$ if that is what you want.
I suggest you consider doing this instead: g:981/100.
RJF
Macsyma converts floating point numbers to rationals, generally because
calculations with rationals model mathematics much better. rationals do
not overflow, underflow, or lose precision. The reason other programs
make floating-point arithmetic "contagious" is they (a) don't have rationals
or (b) value "speed" over accuracy.
RJF
>
>
> As it is, I can write something like float(rhs(d4[2])) but it is a bit
> complicated.
>
> Has anybody any hint as to what to do?
>
> TIA,