Tolerance.is_between
- Tolerance.is_between(value, minval, maxval, atol=None)[source]
Check if a value is between two other values.
- Parameters:
- valuefloat
The value.
- minvalfloat
The minimum value.
- maxvalfloat
The maximum value.
- atolfloat, optional
The absolute tolerance. Default is
None, in which caseself.absoluteis used.
- Returns:
- bool
Trueif the value is between the two other values.Falseotherwise.
Examples
>>> tol = Tolerance() >>> tol.is_between(0.5, 0.0, 1.0) True >>> tol.is_between(1.5, 0.0, 1.0) False