Determines if one number divides evenly into another without remainders. Access via MCP in Cursor or Windsurf for instant divisibility checks in your code, or call GET /v1/math/is-divisible with dividend and divisor parameters. Returns true/false with the exact remainder value. Perfect for modular arithmetic, loop conditions, and mathematical validations where precision matters.
curl "https://tinyfn.io/v1/math/is-divisible" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/is-divisible', {
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/is-divisible',
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"
}
}
}
}
Use the is-divisible tool in your MCP-enabled editor with dividend and divisor parameters. It returns a boolean result plus the remainder for complete mathematical context.
Division by zero returns an error response since it's mathematically undefined. Always validate your divisor is non-zero before calling the function.
Yes, the tool handles negative integers and decimal numbers correctly. For decimals, it checks if dividend/divisor produces a whole number result.
Returns both the boolean divisibility result and the exact remainder value, giving you complete information for further mathematical operations.
This provides deterministic results across different programming languages and handles edge cases consistently, while language-specific modulo operators can vary in behavior with negatives.
Get your free API key and start using Is Divisible in seconds.
Get Free API Key