def METHOD_NAME(self, f):
    assert isinstance(f, float)
    if not self.allow_infinity and math.isinf(f):
        return False
    if not self.allow_nan and math.isnan(f):
        return False
    if self.width < 64:
        try:
            float_of(f, self.width)
            return True
        except OverflowError:  # pragma: no cover
            return False
    return True