{"id":"xpath10-number","version":"1.0.0","description":"Evaluate an XPath 1.0 numeric expression: arithmetic, div, mod, floor, ceiling, round, and number conversion.","supported_operations":["xpath 1.0 number result","xpath div mod addition and multiplication","xpath floor ceiling and round","xpath number function and string-length","compute an xpath 1.0 numeric expression","xpath arithmetic keeping negative zero","xpath ieee 754 division and remainder","מספר xpath number"],"unsupported_operations":["sum a node-set with sum()","exact decimal or integer arithmetic beyond IEEE 754 binary64","XPath 2.0 integer division idiv"],"semantics":["Returns an XPath 1.0 number. result is the exact token, including -0 for negative zero. xpath_string is the section 4.2 string, which is 0 for negative zero. A string or boolean result is unsupported_input reason result_type.","div is IEEE 754 division. Division by zero returns Infinity, -Infinity, or NaN and is not an error. mod is the truncating remainder with the sign of the dividend, the same rule as ECMAScript %. / is a location path and is rejected.","Unary minus is the only unary operator. +1 is a syntax error. 5 mod -2 is 5 mod (-2). Keyword div and mod match only token kind name.","round halves toward positive infinity. round of a number that is less than zero and greater than or equal to -0.5 is negative zero. floor and ceiling follow section 4.4.","number() accepts optional XML whitespace, an optional minus, and an XPath Number. A leading plus, an exponent, or any other text is NaN. Integers are plain decimal with no exponent.","Check order: UTF-8 input bytes, parse limits, the 96-character cap on any string the expression builds, the result type, then the JSON byte cap. Key order is result then xpath_string.","A 23-digit exact integer such as 10^22 fills the 77-byte output cap. A longer exact decimal such as 2^200 is limit_exceeded on output bytes, not a rounded rewrite."],"limits":{"max_input_bytes":512,"max_string_codepoints":96,"max_depth":8,"max_nodes":21,"max_arguments":4,"max_output_bytes":77},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["expression"],"properties":{"expression":{"type":"string","minLength":1,"maxLength":512,"description":"XPath 1.0 value expression. maxLength counts Unicode code points. The UTF-8 cap is limits.max_input_bytes."}}},"output_schema":{"type":"object","additionalProperties":false,"required":["result","xpath_string"],"properties":{"result":{"type":"string","minLength":1,"maxLength":96,"description":"Exact numeric token. Negative zero is -0. NaN, Infinity, and -Infinity are those words."},"xpath_string":{"type":"string","minLength":1,"maxLength":96,"description":"Section 4.2 string value of the number. Negative zero is 0."}}},"examples":[{"input":{"expression":"5 mod 2"},"output":{"result":"1","xpath_string":"1"}},{"input":{"expression":"number(true())"},"output":{"result":"1","xpath_string":"1"}},{"input":{"expression":"-5 mod 2"},"output":{"result":"-1","xpath_string":"-1"}}],"execute_url":"/v1/tools/xpath10-number/versions/1.0.0/execute"}