On 2011-9-14 23:35, Robert Bradshaw wrote:
... Otherwise, z.real, z.imag is probably going to
be as fast as you can get, and there's no need to define a function,
you could just write
sage: a = complex(3,4)
sage: x, y = a.real, a.imag
For trivial cases, yeah, but consider
parametric_p
On Wed, Sep 14, 2011 at 7:57 PM, Anton Sherwood wrote:
> Is there a function inverse to complex(x,y),
> such that (x,y) == ReIm(complex(x,y)) ?
>
> I could obviously write one -- def ReIm(z): return (z.real,z.imag) -- but
> presumably a library function if it exists would be speedier.
For Sage's
Is there a function inverse to complex(x,y),
such that (x,y) == ReIm(complex(x,y)) ?
I could obviously write one -- def ReIm(z): return (z.real,z.imag) --
but presumably a library function if it exists would be speedier.
--
Anton Sherwood *\\* www.bendwavy.org *\\* www.zazzle.com/tamfang
--
T