fibomat.utils.math module#

Provide math helper functions mod_2pi() and float_gcd().

fibomat.utils.math.mod_2pi(val: float) float[source]#

Calculate val % 2*pi.

If val*k % 2*pi == 0, 2*pi is returned for k != 0.

Args:

val: value

Returns:

float

fibomat.utils.math.float_gcd(a: float, b: float, rtol: float = 1e-05, atol: float = 1e-08)[source]#

Calculate gcd for float values.

Args:

a: first value b: second value rtol: relative tolerance atol: absolut tolerance

Returns:

float