signum() not in math?

Marcin 'Qrczak' Kowalczyk qrczak at
Sat Oct 13 18:44:33 CEST 2001

Fri, 12 Oct 2001 11:27:16 +0200, Dinu Gherman <gherman at> 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
  ^^                      SYGNATURA ZASTĘPCZA

More information about the Python-list mailing list