Interval difference
interval_difference · version 1.0.0 · Numbers & math · free, no key needed
Compute the portion of interval a outside interval b.
Use when you need to: interval difference.
Supported
- interval difference
Not supported
- filesystem access
- network access
Behavior
- Deterministic pure computation over the supplied JSON input.
- How requests are recorded is described in the privacy policy: https://computefirst.net/privacy.
Input
a(object, required)b(object, required)
Output
- object
Limits
- max input bytes: 262144
Example
Request input:
{
"a": {
"start": 1,
"end": 10
},
"b": {
"start": 4,
"end": 6
}
}
Response:
{
"result": {
"difference": [
{
"start": 1,
"end": 4
},
{
"start": 6,
"end": 10
}
]
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "interval_difference",
"version": "1.0.0",
"input": {
"a": {
"start": 1,
"end": 10
},
"b": {
"start": 4,
"end": 6
}
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/interval_difference/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"a":{"start":1,"end":10},"b":{"start":4,"end":6}}'
The machine-readable contract is at /v1/tools/interval_difference/versions/1.0.0.
CLI
node cli.mjs run interval_difference 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Decimal subtract: Exact decimal subtraction a minus b of canonicalizable decimal strings.
- Interval contains: Test whether a numeric interval contains a point or interval.
- Interval intersection: Compute the closed intersection of two numeric intervals.
- Interval overlap: Test whether two numeric intervals overlap.
- Interval union: Merge overlapping or adjacent numeric intervals.
- Rational subtract: Subtract one rational number from another, given as numerator/denominator integer strings, and return the reduced difference.