{"id":"decimal-root","version":"1.0.0","description":"Real nth root (2 to 100) of a decimal string, correctly rounded once to a fixed scale with an explicit mode.","supported_operations":["square root to 20 decimal places","cube root of a number with rounding","nth root of a decimal correctly rounded","exact square root of a perfect square decimal","root of a decimal with rounding mode","high precision square root of 2","fourth root or fifth root of a decimal","negative number odd root"],"unsupported_operations":["complex roots of negative numbers","fractional or non integer degrees","exponentiation or logarithms","floating point or scientific notation input"],"semantics":["Decimal strings match ^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$: no plus sign, exponent, leading zeros, leading or trailing point, whitespace or separators. A JSON number where a decimal string is required is invalid_input (wrong type).","A decimal string longer than 62 UTF-16 code units -> limit_exceeded, checked before the grammar. Otherwise a grammar failure, more than 60 digits in total, or more than 40 fraction digits -> invalid_input.","Zero has no sign: \"-0\", \"-0.00\" and any all-zero value are zero and are emitted as \"0\" (canonical) or \"0.00\" (fixed scale), never \"-0\".","value, scale and rounding are required; degree is optional and defaults to 2. degree is a JSON integer 2..100; anything else (1, 101, a string, a float) -> invalid_input.","The result is the real root of the exact rational value, correctly rounded once to scale fraction digits with the given mode. It is never computed through floating point.","Exactness: a perfect power (for example sqrt(\"6.25\") = 2.5 at scale 1, cbrt(\"-27\") = -3) gives exact true. A root that is not representable at the requested scale gives exact false, including an exact tie.","Ties: the true root can lie exactly halfway between two scale-digit neighbours (sqrt(\"0.25\") = 0.5 at scale 0; sqrt(\"6.25\") = 2.5 at scale 0; cbrt(\"-0.125\") = -0.5 at scale 0). The tie modes (half_even, half_up, half_down, half_ceiling, half_floor) then decide as documented. A root a hair above or below a tie is NOT a tie: sqrt(\"0.2500000000000000000000000000000000000001\") at scale 0 rounds to 1 under half_down, and sqrt(\"0.2499999999999999999999999999999999999999\") to 0 under half_up. Detect ties exactly: with r = floor(root * 10^scale) and N = |value| * 10^(scale*degree), the root is a tie iff (2r+1)^degree = 2^degree * N.","A negative value with an even degree -> not_computable with details.reason \"even_root_of_negative\". A negative value with an odd degree gives the negative real root; rounding modes then act on the signed result (floor of -1.2599 at scale 2 is -1.26, ceiling is -1.25, up is -1.26, down is -1.25).","A zero value (including \"-0\") gives zero at scale digits (\"0.00\" at scale 2, \"0\" at scale 0), exact true, never \"-0\". A negative root that rounds to zero is written without a minus sign.","rounding \"unnecessary\" with an irrational or inexact root -> not_computable with details.reason \"rounding_necessary\".","A result rounded to scale s is written with exactly s fraction digits (no fraction and no point when s is 0).","Rounding modes act on the exact rational result and are: half_even (ties to the even neighbour), half_up (ties away from zero), half_down (ties toward zero), half_ceiling (ties toward +infinity), half_floor (ties toward -infinity), up (away from zero), down (toward zero), ceiling (toward +infinity), floor (toward -infinity), unnecessary (any inexact result -> not_computable with details.reason \"rounding_necessary\").","Validation order (each vector carries a single fault): input not an object; unknown field; missing required field; field types, ranges and decimal-string limits; scale/rounding pairing; then domain errors (not_computable) last."],"limits":{"max_decimal_chars":62,"max_decimal_digits":60,"max_fraction_digits":40,"max_scale":40,"min_degree":2,"max_degree":100},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["value","scale","rounding"],"properties":{"value":{"type":"string","minLength":1,"maxLength":62,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Radicand as a decimal string."},"degree":{"type":"integer","minimum":2,"maximum":100,"description":"Root degree, 2 to 100. Default 2 (square root)."},"scale":{"type":"integer","minimum":0,"maximum":40,"description":"Fraction digits of the result."},"rounding":{"type":"string","enum":["half_even","half_up","half_down","half_ceiling","half_floor","up","down","ceiling","floor","unnecessary"],"description":"Rounding mode applied to the true root."}}},"output_schema":{"type":"object","additionalProperties":false,"required":["value","exact"],"properties":{"value":{"type":"string","minLength":1,"maxLength":100,"description":"The root at exactly scale fraction digits (no point when scale is 0)."},"exact":{"type":"boolean","description":"true when the reported value equals the true root (perfect power)."}}},"examples":[{"input":{"value":"2","scale":20,"rounding":"half_even"},"output":{"value":"1.41421356237309504880","exact":false}},{"input":{"value":"6.25","scale":1,"rounding":"half_even"},"output":{"value":"2.5","exact":true}},{"input":{"value":"-27","degree":3,"scale":2,"rounding":"half_up"},"output":{"value":"-3.00","exact":true}}],"execute_url":"/v1/tools/decimal-root/versions/1.0.0/execute"}