Source code for atsim.potentials.config._pymath

import math

import sys

[docs]def ceil(x): return math.ceil(x)
[docs]def copysign(a,b): return math.copysign(a,b)
[docs]def fabs(x): return math.fabs(x)
[docs]def floor(x): return math.floor(x)
[docs]def fmod(a,b): return math.fmod(a,b)
[docs]def fsum(*args): return math.fsum(args)
[docs]def ldexp(a,b): return math.ldexp(a,int(b))
[docs]def trunc(x): return math.trunc(x)
[docs]def exp(x): return math.exp(x)
[docs]def log(*args): return math.log(*args)
[docs]def log1p(x): return math.log1p(x)
if hasattr(math, "log2"):
[docs] def log2(x): return math.log2(x)
else: def log2(x): return math.log(x,2)
[docs]def log10(x): return math.log10(x)
[docs]def pow(x,a): return math.pow(x,a)
[docs]def sqrt(x): return math.sqrt(x)
[docs]def acos(x): return math.acos(x)
[docs]def atan(x): return math.atan(x)
[docs]def atan2(x,y): return math.atan2(x,y)
[docs]def cos(x): return math.cos(x)
[docs]def hypot(x,y): return math.hypot(x,y)
[docs]def sin(x): return math.sin(x)
[docs]def tan(x): return math.tan(x)
[docs]def radians(x): return math.radians(x)
[docs]def degrees(x): return math.degrees(x)
[docs]def acosh(x): return math.acosh(x)
[docs]def asinh(x): return math.asinh(x)
[docs]def atanh(x): return math.atanh(x)
[docs]def cosh(x): return math.cosh(x)
[docs]def sinh(x): return math.sinh(x)
[docs]def tanh(x): return math.tanh(x)
[docs]def factorial(x): return math.factorial(x)
if hasattr(math, "gcd"): _gcd = math.gcd else: import fractions _gcd = fractions.gcd
[docs]def gcd(a,b): return _gcd(int(a),int(b))