On Dec 2, 2008, at 6:12 PM, ggrafendorfer wrote:

> Hi Robert
>> symbolic expression "i^2" is getting turned into CDF(i)^CDF(2).
>
> the i^2 should also be of type CDF, but
>
> sage: type(i^2)
> <class 'sage.calculus.calculus.SymbolicArithmetic'>

Ah, I think I see the misunderstanding now. i^2 should not be of type  
CDF, because i is not of type CDF. (Well, technically, one cares more  
about parents than types). CDF.0 or CDF.gen(0) is the "complex  
double" imaginary unit.

Symbolic Ring
sage: parent(i)
Symbolic Ring
sage: parent(i^2)
Symbolic Ring

sage: CDF.0
1.0*I
sage: parent(CDF.0)
Complex Double Field
sage: parent(CDF.0^2)
Complex Double Field

Generally in Sage we prefer exact arithmetic to numeric  
approximations, because once you start doing numeric things one has  
to deal with rounding errors, etc. and there's no going back.

- Robert




--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
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