Description
Return truncatedRemainder=dividend%divisor using truncation toward zero, euclideanRemainder=(r+abs(divisor)) modulo abs(divisor), and residual=truncated-euclidean, all as decimal strings.
A rational number is represented by an integer numerator and a nonzero integer denominator. Sign placement, reduction by a greatest common divisor, and the chosen division or rounding convention affect intermediate representations. Exact integer text preserves arithmetic that could be lost in a floating-point conversion.
Return truncatedRemainder=dividend%divisor using truncation toward zero, euclideanRemainder=(r+abs(divisor)) modulo abs(divisor), and residual=truncated-euclidean, all as decimal strings.
When to use this tool
Use Signed Remainder Convention Residual when you need this particular exact fraction comparison, reduction, sign, denominator, or rounding component.
How to use the tool and how it works
- Enter dividend, divisor. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read truncatedRemainder, euclideanRemainder, residual. Use the output convention below.
Parse signed decimal-integer dividend and divisor and reject divisor zero. Return truncatedRemainder=dividend%divisor using truncation toward zero, euclideanRemainder=(r+abs(divisor)) modulo abs(divisor), and residual=truncated-euclidean, all as decimal strings.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| dividend | Signed integer dividend in the representation declared below. | Required. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above. |
| divisor | Nonzero integer divisor in the representation declared below. | Required. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| truncatedRemainder | Truncated Remainder | Required. Text; maximum UTF-16 length 8192. |
| euclideanRemainder | Euclidean Remainder | Required. Text; maximum UTF-16 length 8192. |
| residual | Truncated remainder minus Euclidean remainder, as exact decimal text. | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"dividend": "-8",
"divisor": "3"
},
"output": {
"truncatedRemainder": "-2",
"euclideanRemainder": "1",
"residual": "-3"
}
} Limitations and assumptions
- The conventions differ for negative dividends with nonzero remainder. Outputs are exact integer text; this does not choose which remainder convention an external language or application requires.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Reduce fractions where the interpretation requires it and choose a consistent denominator-sign and division convention. Use a complete rational operation when one denominator or determinant term is insufficient.
References
Similar or alternative tools
- Integer Euclidean Quotient Sign Case
Choose remainder in [0,abs(divisor)), then return quotient=(dividend-remainder)/divisor and remainder as exact decimal text.
- Integer Division Zero Remainder Sign
Label exact integer remainder conventions, preserving dividend-signed zero metadata for truncation.