Take look on other numeric tests, e.g. in sympy.functions.