2008/12/29 ggrafendorfer <georg.grafendor...@gmail.com>: > > Hi All, > thanks for all the answers, especially for John Cremona for being the > only one recognizing what I actually wanted to point out :-) > It's probably my fault, I'll take away obscuring examples the next > time and try to focus on the issue > > For better understanding why I did "CC(-5).n(prec=100)" instead of the > better "ComplexField(100)(-5)": > > Originally I just wanted the log of -5, but ln(-5) gives a "value > error" and ln(-5.) returns NaN, > so I wrote ln(CC(-5)) which works and returns a complex number, then I > wanted to increase the precision of the result, > and as -5 can be represented precisely in binary system I just wrote CC > (-5).n(prec=100) which is the same as ComplexField(100)(-5) except > that the number types are different: > > sage: a = CC(-5).n(prec=100) > sage: b = ComplexField(100)(-5) > sage: a == b > True > sage: type(a) == type(b) > False > sage: ln(a) > NaN > sage: ln(b) > 1.6094379124341003746007593332 + 3.1415926535897932384626433833*I
I think that is a very good example, showing more clearly than the original post what the problem is, and convincing me that the behaviour of .n() should be changed as discussed earlier. I am opening a ticket for this now. John > > Georg > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---