Rational reciprocal
rational-reciprocal · version 1.0.0 · Numbers & math · free, no key needed
Invert a rational number given as a numerator/denominator integer-string pair.
Use when you need to: rational reciprocal · invert fraction · multiplicative inverse of a rational.
Decide before calling
Read the versioned contract and the supported scope below. Reuse rational-reciprocal@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use rational-reciprocal@1.0.0 for rational reciprocal. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- rational reciprocal
- invert fraction
- multiplicative inverse of a rational
- flip fraction
Not supported
- decimal reciprocal
- reciprocal of zero
- mixed numbers
Behavior
- Input is an object with canonical integer-string numerator and denominator fields.
- The denominator must be a positive canonical integer; zero and negative denominators are rejected.
- The input may use -0 on the numerator, canonicalized to 0.
- A zero numerator is rejected: the reciprocal of 0 is undefined.
- The output swaps numerator and denominator, with the sign normalized onto the output numerator.
- Each input and output numerator and denominator may have at most 1000 digits excluding sign.
Input
numerator(string, required): max length 1001denominator(string, required): max length 1001
Output
numerator(string, required)denominator(string, required)
Limits
- max digits: 1000
Example
Request input:
{
"numerator": "3",
"denominator": "4"
}
Response:
{
"result": {
"numerator": "4",
"denominator": "3"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "rational-reciprocal",
"version": "1.0.0",
"input": {
"numerator": "3",
"denominator": "4"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/rational-reciprocal/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"numerator":"3","denominator":"4"}'
The machine-readable contract is at /v1/tools/rational-reciprocal/versions/1.0.0.
CLI
node cli.mjs run rational-reciprocal 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Rational equation check: Check a chained claim like 1/2 + 1/3 = 5/6 < 1 exactly; returns the first false relation or division by zero.
- Rational expression check: Check a claimed exact rational value of an integer/fraction expression; reports the true value and the difference.
- Rational power: Raise a rational number to an integer exponent and return the exact reduced result.
- Rational trace check: Check a step-by-step rational calculation trace; reports the first step whose operand, operator or result disagrees.
- Array rational sum: Sum an array of canonical rationals and return the reduced total.
- Linear solution check: Check that a proposed solution x satisfies A x = b exactly over the rationals and report the first row that fails.