Strange floating point behaviour



> I have this work sheet (I teach at a high school):

Great to see Maxima being used in a high school!

Your example:

  g : 9.81;
  x(t,v0) := g/2*t^2+v0*t;
  solve(x(t,0)=50.0,t);
    => [t = -100/(3*SQRT(109)),t = 100/(3*SQRT(109))]

And you wonder why the result is not given in floating point.  You are
certainly not the first to want it in floating point!  Unfortunately,
there is currently no way to force Maxima to carry out this calculation
entirely in floating point.

You can write solve(...),float:true and get a floating-point result, but
internally it will still be calculating internally in rational numbers,
as you can see from its informational messages (which, by the way, you
can turn off with ratprint:false).  Also, by default the conversion to
rationals is only accurate to 1 in 10^-8.  (This can be changed by
setting ratepsilon:1.0e-16, for example.)

You can also write, as you say, float(solve(...)), which converts
everything to floats after having performed the calculation internally
with rationals.

solve(...),keepfloat doesn't actually do the right thing in this case.
solve(...),numer returns a pretty much correct but peculiar result (t =
3.192*%E^(6.283*%I).

This is all rather messy and confusing, and I am not happy with this
situation, but I'm afraid that's the way it is for now.

        -s