'Return true if the given value is equal to the expected value within
the pre-specified tolerance.'

def __eq__(self, actual):

    if (actual == self.expected):
        return True
    if math.isnan(abs(self.expected)):
        return (self.nan_ok and math.isnan(abs(actual)))
    if math.isinf(abs(self.expected)):
        return False
    return (abs((self.expected - actual)) <= self.tolerance)
