Hi,
I'm not sure, but I guess this is considered as a bug, please let me
know and I report it to trac:

sage: a = RealField(100)(5) + float(5); type(a); a.prec()
<type 'sage.rings.real_mpfr.RealNumber'>
100
sage: a = float(5) + RealField(100)(5); type(a); a.prec()
<type 'sage.rings.real_mpfr.RealNumber'>
100

the same happens with multiplication,

actually there are 2 issues:
1.) the result should have the same precision as the operand with
lower precision,
2.) the result should have the same type as the first operator (we
discussed this once in a different thread were I've been told that
this is a general rule, at least this rule applies between real's with
53-bit precision and RDF's)

this happens for example with the function 'numerical_integral' which
returns a float, if the result is multiplied with a higher precision
real number the result also magically turns into higher precision.

Georg
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to