{"uid":"cap_EDRMgxV93sSg9uhs5UX3y","slug":"fraction-arithmetic-openverbs-dc8d3aa3","name":"Fraction Arithmetic (OpenVerbs)","description":"Add, subtract, multiply or divide two fractions and return the exact, fully-reduced result. All computation is done in BigInt so there is no floating-point error. Dividing by a zero fraction is a clean 400.","url":"https://fraction.openverbs.com/v1/arithmetic","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["a","b","operation"],"properties":{"a":{"type":"object","required":["numerator"],"properties":{"numerator":{"type":"integer"},"denominator":{"type":"integer","description":"Default 1."}},"description":"First fraction.","additionalProperties":false},"b":{"type":"object","required":["numerator"],"properties":{"numerator":{"type":"integer"},"denominator":{"type":"integer","description":"Default 1."}},"description":"Second fraction.","additionalProperties":false},"operation":{"enum":["add","subtract","multiply","divide"],"type":"string","description":"The operation."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_BAg34Z_dTJt2h9CGrPm_z","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Performs exact, fully-reduced arithmetic (add, subtract, multiply, divide) on two fractions using BigInt with no floating-point error","exampleAgentPrompt":"Can you add 3/4 and 5/6 and give me the exact reduced fraction result — no decimals, just the precise answer?","exampleUseCases":[{"title":"Splitting costs between contributors","prompt":"I need to divide 7/12 by 3/4 exactly — it's for splitting a shared expense ratio and I can't have any rounding errors, so give me the fully reduced fraction."},{"title":"Combining ingredient ratios in a recipe","prompt":"Can you add 2/3 and 3/8 together? I'm scaling recipe proportions and need the exact fractional answer, not a decimal approximation."},{"title":"Verifying student fraction homework","prompt":"What's 5/9 minus 1/6? I want the exact reduced fraction so I can check whether a student's answer is correct."}],"resultDescription":"A fully reduced fraction representing the exact result of the arithmetic operation, expressed as a numerator and denominator with no floating-point rounding. Division by zero returns a clean 400 error.","failureModes":["Division by a zero-valued fraction (b numerator is 0 and operation is divide) returns HTTP 400","Missing required fields (a, b, or operation) return a validation error","Non-integer numerator or denominator values cause schema rejection","Invalid operation string (not add/subtract/multiply/divide) causes a 400 error"],"whenToPreferThis":"Choose this endpoint when exact rational arithmetic is required — no floating-point approximation is acceptable. Ideal for financial calculations, recipe scaling, educational tools, or any domain where 1/3 + 1/6 must equal exactly 1/2, not 0.4999999. Prefer this over general-purpose calculators or math libraries when the inputs are known fractions and the output must be a fully reduced fraction.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:31:38.433Z","isFirstParty":false}