#4 keepfloat needed for bfloats


rat(0.5b0),keepfloat => 1/2

It would be nice if keepfloat (or some variant) preserved
bfloats as well as floats. This would mean (among other
things) that ordinary m^^-1 could be used with bfloat
matrices (instead of Invert, which is far slower).

This seems to need changes to fewer than a dozen
places in the Rat package. The main concern would be
that PCoefP would have to be a bit longer, and it is used
pretty extensively in the Rat package -- I wouldn't want
to add significant overhead to all of Rat for this case.

But it appears that this is not a problem.

Instead of

(atom x)

PCoefP would have to be

(or (atom x) (and (listp (car x)) (eq (caar x) 'bigfloat)))

Actually, I think we could even do the simpler

(or (atom x) (listp (car x)))

since non-coefp objects in CRE always start with an
atom (I think!).

Note that the speed would be pretty much unaffected,
since almost all calls to PCoefP have an atomic
argument; it would just add a few words of length.


  • Robert Dodier

    Robert Dodier - 2006-07-02
    • labels: --> 460522
  • Robert Dodier

    Robert Dodier - 2006-09-09
    • labels: 460522 --> 887077
  • Dieter Kaiser

    Dieter Kaiser - 2010-03-21
    • labels: 887077 -->
  • Dieter Kaiser

    Dieter Kaiser - 2010-03-21

    I think this report is a feature request and not a bug. Changing the tracker to feature request.
    Dieter Kaiser


Log in to post a comment.