signum() not in math?

Des Small des.small at bristol.ac.uk
Fri Oct 12 05:38:37 EDT 2001


Dinu Gherman <gherman at darwin.in-berlin.de> writes:

> Hi!
> 
> Time for a periodic frenzy about the standard lib again... ;-)
> How comes there is no sign() or signum() function in math?

The only possible controversy would be the definition at zero.  I
usually define signum(0) = 0, but others may not.  I don't even want
to think about the differences between +0 and -0 in this case.

I certainly endorse the sentiment that it should be available in the
standard library, but now that I come to look (and prompted by your
use of "sign()") I find that there _is_ a sign function in Numeric.
Since I always use Numeric, this removes much of the urgency.

> Surprising. Ahh, a missing PEP, even? That could be
> the case... ;-)

I think there is a sentiment that Numeric should be absorbed into the
standard library, after the code has been cleaned up (which noone has
time to do).

> Waiting-for-the-Snake-Oracle's-advice'ly,
> 
> Dinu

Des.
-- 
Dr Des Small, Scientific Programmer,
School of Mathematics, University of Bristol,
Tel: 0117 9287984



More information about the Python-list mailing list