no sign() function ?

Pierre-Alain Dorange pdorange at
Mon Dec 22 11:18:00 CET 2008

I don't find any sign(x) function in the math library (return the sign
of the value).
I've read that math module is a wrapper to C math lib and that C math
lib has not sign(), so...

I've implement my own sign function of course (it's easy) but a standard
one in math would be better and could be faster.

How do you implement this or is there any other module with a sign()
function ?

Pierre-Alain Dorange        <>

Ce message est sous licence Creative Commons "by-nc-sa-2.0"

More information about the Python-list mailing list