Ticket #468 (closed defect: fixed)
[with patch] quaddouble wrapper sets fpu precision to 53 bits for entire sage session
| Reported by: | bober | Owned by: | bober |
|---|---|---|---|
| Priority: | major | Milestone: | sage-2.8.7 |
| Component: | basic arithmetic | Keywords: | quaddouble, fpu, ReadQuadDouble |
| Cc: | Author(s): | ||
| Report Upstream: | Reviewer(s): | ||
| Merged in: | Work issues: |
Description
sage/rings/real_rqdf.pyx contains the following code:
cdef class RealQuadDoubleField_class(Field):
"""
Real Quad Double Field
"""
def __init__(self):
fpu_fix_start(self.cwf)
def __dealloc__(self):
fpu_fix_end(self.cwf)
On systems where fpu_fix_start() does something, it sets the fpu precision to 53 bits. A poor side effect of this is that the type long double ought to have 64 bits of precision on some systems, but it doesn't when it is used in code run from SAGE.
The short term fix will be to rewrite the wrapper to have an fpu_fix_start() and fpu_fix_end() call before and after every arithmetic operation on a RealQuadDouble element, and nowhere else, to make sure that the quaddouble wrapper doesn't ever unexpected change the fpu precision.
It would also be nice to have a doctest that can check the fpu precision, so it can be checked that nothing ever changes it unexpectedly.

