Decimal integer-degree roots by exact power comparisons #
The integer root brackets the scaled coefficient. Comparing the radicand with the power of the exact midpoint decides nearest rounding, including ties. Precision, degree, and intermediate integers are unbounded.
Negative degrees invert the exact rational radicand before root rounding. Negative nonzero operands require an odd degree. Signed zeros follow the same odd-degree sign rule; a negative degree at zero raises divide-by-zero.
Decimal grid shift for a root of positive integer degree.
Instances For
Integer floor of a nonnegative rational's positive-degree root.
Instances For
Exact decision between adjacent coefficients, with directed rounding respecting sign.
Instances For
Round a nonnegative root magnitude on the integer grid.
Instances For
Rounded root coefficient and quantum, after an exact power-of-ten carry.
Instances For
Round a positive-degree root of a nonnegative rational magnitude. Only the final root can raise overflow or underflow. Exact results retain the preferred cohort, and inexactness is decided by an exact power equality.
Instances For
Integer-degree root with one final rounding. Degree zero is invalid for every operand, including NaNs. Other degrees use the usual decimal NaN propagation. For an exact finite result, the preferred quantum is the floor of the signed operand quantum divided by the positive degree magnitude.