On Mon, Dec 29, 2008 at 4:16 PM, ggrafendorfer
<[email protected]> wrote:
>
> Hi,
> this is somehow related to this thread:
>
> http://groups.google.com/group/sage-support/browse_thread/thread/151415480ecebc1a
>
> Assume that 'a' is a *negative* real number with some precision not
> equal to 53 bit and I want to coerce it to a complex number preserving
> its precision (for example to take the logarithm of it),
> is there an easier (more elegant) way to do this than
>
> sage: b = ComplexField(a.prec())(a)
>
> ??
>
> thanks,
> Georg

I don't know of a better way.  There *should* be a command

   a.complex_number()

that does what you want, but nobody wrote it.  I would suggest that somebody
write it and the implementation simply be what you wrote above.  Then
somebody could create a second patch to Sage that might make it much
faster, by directly using the underlying implementation of real and
complex arbitrary precision numbers.

William

--~--~---------~--~----~------------~-------~--~----~
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