* Added MathWarning for mathematics-related warning messages.

This commit is contained in:
Wirawan Purwanto
2014-03-28 14:29:10 -04:00
parent 04e78ade1d
commit 3b0a8af1aa

View File

@@ -8,8 +8,16 @@ pass
import numpy
class MathWarning(Warning):
"""Base class for mathematics-related warnings for wpylib library.
"""
ZERO_TOL = 5.0e-16
def ztol(val, tol=None, copy=True):
"""Rounds down values to zero if they are below tolerance."""
if tol == None: tol = ZERO_TOL