def eps(X): try: return np_finfo(dtype(X)).eps except: return np_finfo(np_float64).eps
def safeDecrement(self, map, px, py, value): """Decrement a value and make sure it's not negative or something shitty""" map[px][py] -= value if map[px][py] < np_finfo(float).eps: map[px][py] = 0
def resolution(X): try: return np_finfo(dtype(X)).resolution except: return np_finfo(np_float32).resolution