def oct(x): if isinstance(x, int): return _oct(x) else: if _is_pointZero(x): return _oct(int(x)) else: return x
def hex(x): if isinstance(x, int): return _hex(x) else: if _is_pointZero(x): return _hex(int(x)) else: raise x
def bin(x): if isinstance(x, int): return _bin(x) else: if _is_pointZero(x): return _bin(int(x)) else: return x
def round(x, *dig): # in parsefuncs.function_handler.used_optlist if len(dig) == 0: return _round(x) else: if not _is_pointZero(dig[0]): raise MathError('<font color=red>round( )</font> ' +\ translate('MathErrors', _errors['oivDig'])) else: return _round(x, int(dig[0]))
def rt(x, N): if _is_pointZero(N) and N >= 2: if x < 0: if N % 2: return _abs(x)**(1/N) * -1 else: raise MathError(translate('MathErrors', _errors['mde'])) else: return x**(1/N) else: raise MathError(translate('MathErrors', _errors['mde']))
def rt(x, N): if _is_pointZero(N) and N >= 2: if x < 0: if N % 2: return _abs(x)**(1 / N) * -1 else: raise MathError(translate('MathErrors', _errors['mde'])) else: return x**(1 / N) else: raise MathError(translate('MathErrors', _errors['mde']))
def fact(n): if _is_pointZero(n): if 0 <= n <= 64: return _factorial(n) elif n < 0: raise MathError('<font color=red>fact()</font> ' +\ translate('MathErrors', _errors['nv'])) else: raise MathError('<font color=red>fact()</font> ' +\ translate('MathErrors', _errors['fac64'])) else: raise MathError('<font color=red>fact()</font> ' +\ translate('MathErrors', _errors['oiv']))