{"uid":"cap_Ijpr9TMp41nOq6xDR1YbT","slug":"fittings-arithmetic-expression-evaluator-29b20dbd","name":"fittings Arithmetic Expression Evaluator","description":"Evaluates an arithmetic expression in exact rational arithmetic and returns the fraction plus a decimal to the requested precision.","url":"https://fittings.sh/v1/calc/evaluate","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["expression"],"properties":{"precision":{"type":"number","description":"Decimal places, 0-200, default 20"},"expression":{"type":"string","description":"Arithmetic over + - * / ^ and parentheses, 512 characters or fewer"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004199","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004199/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004199","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004199","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GFCkHfVhOIfajqaLMWN5g","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004199","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Evaluates an arithmetic expression in exact rational arithmetic and returns the result as a fraction and a decimal to the requested precision.","exampleAgentPrompt":"Can you evaluate the expression (355/113 + 22/7) / 2 exactly and give me the result as both a fraction and a decimal to 50 decimal places?","exampleUseCases":[{"title":"Exact fraction arithmetic for finance","prompt":"What is 1/3 + 1/6 + 1/9 expressed as an exact fraction and as a decimal to 30 decimal places?"},{"title":"Verifying a geometric computation","prompt":"Evaluate (3^2 + 4^2)^(1/2) for me — give me both the exact rational form and 20 decimal places of precision."},{"title":"Checking a compound arithmetic identity","prompt":"Is (1 + 1/2 + 1/3 + 1/4 + 1/5) exactly 137/60? Compute the expression and show me the fraction and decimal to 10 places."}],"resultDescription":"Returns the evaluated result as an exact rational fraction (numerator/denominator) and as a decimal string rounded to the requested number of decimal places (0–200, default 20). Both representations are provided so callers can verify exact arithmetic and read human-friendly decimals.","failureModes":["expression too long (>512 characters) — returns an error","invalid characters or unsupported operators in expression — parse error returned","division by zero in expression — error indicating undefined result","precision out of range (<0 or >200) — validation error","malformed query parameter — HTTP 400"],"whenToPreferThis":"Choose this endpoint when you need exact rational arithmetic without floating-point rounding errors, especially for expressions involving fractions, integer powers, or repeated division. It is ideal when both a human-readable decimal and an exact fraction representation are needed. Prefer it over general-purpose calculators or LLM math when reproducibility and exactness matter (e.g., financial calculations, mathematical proofs, scientific constants).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:32:07.423Z","isFirstParty":false}