Skip to content

Main content

Rational Signed Denominator Crossproduct Order Tool

Calculate rational signed denominator crossproduct order from explicit caller-supplied inputs.

Loading tool…

Description

Compare left=a*d and right=c*b using exact integer arithmetic, then reverse the comparison if the denominator signs differ; return order=-1,0,1 for first fraction versus second.

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.

Compare left=a*d and right=c*b using exact integer arithmetic, then reverse the comparison if the denominator signs differ; return order=-1,0,1 for first fraction versus second.

When to use this tool

Use Rational Signed Denominator Crossproduct Order when you need this particular exact fraction comparison, reduction, sign, denominator, or rounding component.

How to use the tool and how it works

  1. Enter firstNumerator, firstDenominator, secondNumerator, secondDenominator. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read order. Use the output convention below.

Parse four decimal integers and require nonzero denominators. Compare left=a*d and right=c*b using exact integer arithmetic, then reverse the comparison if the denominator signs differ; return order=-1,0,1 for first fraction versus second.1

Input fieldMeaning and unitsAccepted input
firstNumeratorFirst NumeratorRequired. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above.
firstDenominatorFirst DenominatorRequired. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above.
secondNumeratorSecond NumeratorRequired. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above.
secondDenominatorSecond DenominatorRequired. Text; maximum UTF-16 length 8192. Integer syntax: optional + or - and 1-128 decimal digits; leading zeros accepted. Apply the sign restriction above.
Output fieldInterpretationReturned shape
order−1, 0, or 1 for the first value relative to the second.Required. Safe integer.
json
{
  "input": {
    "firstNumerator": "1",
    "firstDenominator": "-2",
    "secondNumerator": "1",
    "secondDenominator": "3"
  },
  "output": {
    "order": -1
  }
}

Limitations and assumptions

  • Fractions need not be reduced and signed denominators are accepted. This compares exact rationals without converting to floating point, ordering uncertain values, or selecting a rounded display.
  • 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

  1. Calculation and input contract: number/rational-signed-denominator-crossproduct-order — tool.io

Similar or alternative tools