Integer add
integer-add · version 1.0.0 · Numbers & math · free, no key needed
Add two canonical signed integer strings and return their canonical sum.
Use when you need to: integer add · add two integers · sum two integer strings.
Supported
- integer add
- add two integers
- sum two integer strings
Not supported
- decimal add
- floating point add
- integer multiply
- scientific notation
- locale digit grouping
- hexadecimal add
Behavior
- Inputs a and b are signed base-10 integer strings parsed with BigInt.
- A canonical integer is 0 or an optional ASCII minus followed by a non-zero leading digit and only digits after that.
- Input -0 is accepted and canonicalized to 0; +, spaces, underscores, hex, exponents, empty strings, and other leading zeros are rejected.
- The output value is the canonical integer string of a + b.
- Each input and the sum may have at most 1000 digits excluding the sign.
Input
a(string, required): max length 1001; pattern^-?(0|[1-9][0-9]*)$b(string, required): max length 1001; pattern^-?(0|[1-9][0-9]*)$
Output
value(string, required): max length 1001; pattern^(0|-?[1-9][0-9]*)$
Limits
- max digits: 1000
Example
Request input:
{
"a": "19",
"b": "23"
}
Response:
{
"result": {
"value": "42"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "integer-add",
"version": "1.0.0",
"input": {
"a": "19",
"b": "23"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/integer-add/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"a":"19","b":"23"}'
The machine-readable contract is at /v1/tools/integer-add/versions/1.0.0.
CLI
node cli.mjs run integer-add 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Array integer cumulative sum: Replace an array of canonical integer strings with equal-length prefix sums.
- Array integer mode: Return the most frequent canonical integers, listing every mode in first-seen order.
- Array integer sum: Sum an array of canonical integer strings and return the canonical total.
- Integer compare: Compare two canonical signed base-10 integer strings using BigInt.
- Integer GCD: Compute the non-negative greatest common divisor of two canonical integer strings.
- Integer LCM: Compute the non-negative least common multiple of two canonical integer strings.