Changes between Initial Version and Version 1 of Ticket #18836, comment 9


Ignore:
Timestamp:
02/17/16 00:06:54 (6 years ago)
Author:
nbruin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18836, comment 9

    initial v1  
    99}}}
    1010It could well be that this is really the intention (and there could be other places where the interval is set to be a real thing!), in which case the bug is indeed in `sqrt`, which should avoid relying on "argument" being available.
     11
     12Looking at it a little bit more, I think the error is in fact in `__pow__` (sage/rings/qqbar.py:4233). I expect it's  not invalid for `_value` to be a RIF element. That seems to happen quite a bit:
     13{{{
     14sage: type(QQbar(5)._value)
     15<type 'sage.rings.real_mpfi.RealIntervalFieldElement'>
     16}}}
     17It's just that elements where that happens are usually filtered out earlier. So in this case, `d` isn't recognized as a rational number yet when we enter, but then in the for loop on line 4304, we have that on line 4322 we execute:
     18{{{
     19               val = self._interval_fast(prec)
     20}}}
     21So actually, on the first pass `val` is a CIF element. We apparently get an error on the second pass, when `val` has been forced through `_interval_fast`.
     22
     23So I see two solutions: either ensure that val is put back into CIF or ensure that "argument extraction" is done appropriately in cases where "val" is in RIF.