I have am coding the algorithm of Bolzano in Python. This is my code for now: def Bolzano(fonction, a, b, tol=0.000001): while abs(b-a)>tol: m=(a+b)/2 if cmp(fonction(m))==cmp(fonction(a)): a=m else: b=m return a, b It works until it encounters cmp, which it doesn't recognise. However I don't see another way to do it, since Python doesn't have a sign function. Is there any other way to extract the sign of a number? Continue reading...