Returns the sum of the values (Σ valuesᵢ). Decimal-exact internally (40 significant digits), so [0.1, 0.2] returns 0.3. Negatives and zero are allowed.
Request
{
"values": [
0.1,
0.2,
0.3
]
}
Response
{
"success": true,
"data": {
"operation": "add",
"result": 0.6
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns values₀ − values₁ − values₂ − …, evaluated strictly left to right — the array is the expression. Requires at least two values.
Request
{
"values": [
10,
3,
4
]
}
Response
{
"success": true,
"data": {
"operation": "subtract",
"result": 3
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns the product of the values (Π valuesᵢ). Decimal-exact internally.
Request
{
"values": [
2,
3,
4
]
}
Response
{
"success": true,
"data": {
"operation": "multiply",
"result": 24
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns values₀ ÷ values₁ ÷ values₂ ÷ …, evaluated strictly left to right. A zero divisor is a DIVISION_BY_ZERO domain error (HTTP 422), not a validation error.
Request
{
"values": [
100,
4,
5
]
}
Response
{
"success": true,
"data": {
"operation": "divide",
"result": 5
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns (percentage / 100) × value. Both inputs are finite numbers; negatives are allowed.
Request
{
"percentage": 15,
"value": 240
}
Response
{
"success": true,
"data": {
"operation": "percent-of",
"result": 36
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns ((to − from) / from) × 100 as percent points (so 25 means +25%). The signed from value is the denominator; from = 0 has no defined relative change and yields DIVISION_BY_ZERO (HTTP 422).
Request
{
"from": 80,
"to": 100
}
Response
{
"success": true,
"data": {
"operation": "percentage-change",
"result": 25
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns base^exponent. 0^0 = 1 and 0^positive = 0 by convention; 0^negative yields DIVISION_BY_ZERO (422); a negative base with a non-integer exponent yields UNDEFINED_RESULT (422); overflow yields UNDEFINED_RESULT (422).
Request
{
"base": 2,
"exponent": 10
}
Response
{
"success": true,
"data": {
"operation": "power",
"result": 1024
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns the principal (non-negative) square root. A negative input has no real square root and yields UNDEFINED_RESULT (HTTP 422).
Response
{
"success": true,
"data": {
"operation": "sqrt",
"result": 12
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns the principal real degree-th root of the value. The degree is an integer from 1 to 10,000. An even root of a negative value yields UNDEFINED_RESULT (422); odd roots of negatives return the negative real root.
Request
{
"value": 27,
"degree": 3
}
Response
{
"success": true,
"data": {
"operation": "nth-root",
"result": 3
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns the logarithm of the value to the given base. The base is optional and defaults to 10. value ≤ 0, base ≤ 0 and base = 1 yield UNDEFINED_RESULT (HTTP 422).
Response
{
"success": true,
"data": {
"operation": "log",
"result": 3
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns the natural logarithm (base e). value ≤ 0 yields UNDEFINED_RESULT (HTTP 422).
Response
{
"success": true,
"data": {
"operation": "ln",
"result": 0
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns n! for an integer n from 0 to 1,000 (0! = 1). Exact integer results beyond Number.MAX_SAFE_INTEGER are returned as decimal strings and are never rounded.
Response
{
"success": true,
"data": {
"operation": "factorial",
"result": 120
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns the greatest common divisor of two integers, sign-independently. gcd(0, b) = |b|; gcd(0, 0) yields UNDEFINED_RESULT (HTTP 422). Both inputs must be safe integers.
Response
{
"success": true,
"data": {
"operation": "gcd",
"result": 6
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns the least common multiple of two integers, sign-independently. lcm(0, b) = 0; lcm(0, 0) yields UNDEFINED_RESULT (HTTP 422). Both inputs must be safe integers.
Response
{
"success": true,
"data": {
"operation": "lcm",
"result": 12
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns the number of ordered selections P(n, r) = n! / (n − r)!. n and r are integers from 0 to 1,000 and the contract requires r ≤ n. Exact integer results beyond Number.MAX_SAFE_INTEGER are returned as decimal strings.
Response
{
"success": true,
"data": {
"operation": "permutations",
"result": 20
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}
Returns the number of unordered selections C(n, r) = n! / (r! (n − r)!). n and r are integers from 0 to 1,000 and the contract requires r ≤ n. Exact integer results beyond Number.MAX_SAFE_INTEGER are returned as decimal strings.
Response
{
"success": true,
"data": {
"operation": "combinations",
"result": 2598960
},
"meta": {
"requestId": "req_...",
"timestamp": "2026-01-01T00:00:00.000Z"
}
}