IsIntegerInRange🔗
Check that the integer
text is within the given range.
The
text is expected to consist of decimal digits with an optional
sign.
Code
digits = text.lstrip("+-").lstrip("0")
if text[:1] == "-":
return _is_magnitude_at_most(digits, max_negative)
return _is_magnitude_at_most(digits, max_positive)