Multiply performs exact multiplication of two or more numbers, returning precise decimal results without floating-point errors. Access via MCP in Cursor or Windsurf, or call GET /v1/math/multiply with comma-separated values. Example: multiply(2.5, 4, 1.2) returns 12.0. Handles large numbers and maintains precision for financial calculations.
curl "https://tinyfn.io/v1/math/multiply" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/multiply', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/math/multiply',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's math tools:
{
"mcpServers": {
"tinyfn-math": {
"url": "https://tinyfn.io/mcp/math",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Pass numbers as separate parameters: multiply(5, 3, 2) returns 30. The tool accepts any number of arguments and multiplies them sequentially.
Yes, it uses arbitrary precision arithmetic to avoid floating-point errors. multiply(0.1, 0.2, 0.3) returns exactly 0.006, not 0.005999999999999999.
Zero returns zero as expected. Negative numbers follow standard rules: multiply(-5, 3, -2) returns 30 (negative × positive × negative = positive).
Yes, it handles arbitrarily large integers and high-precision decimals. Useful for financial calculations, scientific computing, or when JavaScript's Number.MAX_SAFE_INTEGER isn't sufficient.
TinyFn's multiply avoids JavaScript's floating-point precision issues and supports unlimited precision arithmetic, making it reliable for exact decimal calculations.