Math Utilities

Is Divisible

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.

API Endpoint

GET /v1/math/is-divisible

Code Examples

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)

Use via MCP

Add to your AI agent

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"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I check if a number is divisible by another using MCP?

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.

What happens when I check divisibility by zero?

Division by zero returns an error response since it's mathematically undefined. Always validate your divisor is non-zero before calling the function.

Can I check divisibility with negative numbers and decimals?

Yes, the tool handles negative integers and decimal numbers correctly. For decimals, it checks if dividend/divisor produces a whole number result.

Does the API return just true/false or additional information?

Returns both the boolean divisibility result and the exact remainder value, giving you complete information for further mathematical operations.

How is this different from using modulo operators in code?

This provides deterministic results across different programming languages and handles edge cases consistently, while language-specific modulo operators can vary in behavior with negatives.

Try Is Divisible Now

Get your free API key and start using Is Divisible in seconds.

Get Free API Key