[SciPy-dev] New in fastumath ~ (means conjugate on floats and complex numbers)

Travis Oliphant oliphant.travis at ieee.org
Sun Feb 24 21:22:55 CST 2002


On Sunday 24 February 2002 01:24 am, you wrote:
> I finally realized that with a simple change we can use the unary operator
> on floats and complex numbers to mean complex conjugation.
>
> I've made the simple change in the CVS version of fastumath.
>
> So, in scipy complex-conjugation is as simple as
>
> ~a
>
> if a is a complex number (or a float).
>
> The only problem is that if a is an integer it still means bitwise
> inversion.
>
> Is the added convenience worth the possible confusion?  The problem is that
> complex conjugation happens all the time, but bitwise inversion rarely.

So, what if we made ~ consistently complex conjugation and eliminated the 
confusion.  The invert would still be available as a function call.   

We could also make changes to any of the other symbols as well while we are 
at it if the demand is there.  We can do this without making any changes to 
Numeric as well.

Let me know.  If no one likes the idea but likes writing conjugate(myarray) 
everywhere then I'll back out the changes.

-Travis



More information about the Scipy-dev mailing list