signum() not in math?

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sat Oct 13 12:44:33 EDT 2001


Fri, 12 Oct 2001 11:27:16 +0200, Dinu Gherman <gherman at darwin.in-berlin.de> pisze:

> How comes there is no sign() or signum() function in math?

You could use cmp(x,0) if it was guaranteed that it returns only
-1,0,1. Unfortunately it's not said in docs; it happens to work
though. Perhaps docs should be changed...

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list