[email protected] (Pierre-Alain Dorange) writes: > def sign_0(x): > if x==0.0: > return 0.0 > elif x>0.0: > return 1.0 > else: > return -1.0 >
This might be slightly faster:
def sign(x):
return 1 if x > 0 else x and -1
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
