Ralf Stephan wrote:
> Do I understand it right that then I can coerce a real to a complex
> ball and always back to a real without raising an exception?

Coerce, no; convert, yes, I think (assuming that by "a real" you mean 
"an element of a RealField"), but that's an implementation detail, not 
something you should rely on.

> It does not work with interval fields:
> sage: RR(CIF(1))
> 1.00000000000000
> sage: RR(CIF(1/7))
> ...
> TypeError: unable to convert '0.1428571428571429?' to a real number

But here, you aren't converting back something that was obtained by 
converting a floating-point number. Is isn't going to work in this case, 
even with ball fields.

And unlike ball fields, interval fields do round floating-point numbers 
to the interval field precision, so that converting back is not possible 
in general.

-- 
Marc

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to