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.
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.
Log in to post a comment.