float to bfloat



>>>>> "Richard" == Richard Fateman <fateman@cs.berkeley.edu> writes:

    Richard> If you can set the epsilon, then you could set it to less than 10^(-18)
    Richard> and get the behavior you want, assuming it is a relative error, and get
    Richard> the behavior you want.  The argument against it is, I think, this:

    Richard> bfloat(0.1)  is a float-to-bigfloat conversion.   Do you want it to
    Richard> come out as the bigfloat version of 1/10, 0.1000000000000000000,
    Richard> actually... 1.0b-1  or do you want it to come
    Richard> out as the bigfloat version of .99999994039535522...
    Richard> The first of these requires a lot less explanation to most people.
    Richard> In either case a careful explanation should be available so the
    Richard> behavior is not viewed as a bug.

I played a bit with this.  The function maxima-rationalize and ration1
support ratepsilon.  However, fixfloat rebinds ratepsilon to 2^-53 (53
= machine-mantissa-precision).

Not sure what the best solution would be.  We can change fixfloat so
that it doesn't rebind ratepsilon.  Don't know what that would break,
if some code expects fixfloat to produce the closest rational.  Or we
can change floattofp so that it doesn't call fixfloat.

Ray