IsXsDouble🔗

Type: Transpilable verification function
Check that text is a valid xs:double.

We check that the text matches the pattern of xs:double, and that it does not overflow, i.e. , that it does not round to infinity unless it is INF or -INF. See XsDoubleOverflowThreshold.

See: https://www.w3.org/TR/xmlschema-2/#double

text🔗
Text to be checked
Return🔗
True if the text is a valid xs:double

Code

if not matches_xs_double(text):
    return False

if text == "INF" or text == "-INF" or text == "NaN":
    return True

return _is_decimal_magnitude_below(text, Xs_double_overflow_threshold)