Tolerance.is_negative

Tolerance.is_negative(a, tol=None)[source]

Check if a value can be considered a strictly negative number.

Parameters:
afloat

The value.

tolfloat, optional

The absolute tolerance. Default is None, in which case self.absolute is used.

Returns:
bool

True if the value is small enough to be considered zero. False otherwise.

Examples

>>> tol = Tolerance()
>>> tol.is_negative(-1e-07)
True
>>> tol.is_negative(-1e-10)
False