Returns true/false for whether a number is odd using modulo arithmetic. Access via GET /v1/math/is-odd endpoint or through MCP in Cursor and other AI editors. Perfect for conditional logic, data filtering, and mathematical operations where parity matters. Handles integers, floats, and negative numbers reliably.
curl "https://tinyfn.io/v1/math/is-odd" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/is-odd', {
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-odd',
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"
}
}
}
}
Send a GET request to /v1/math/is-odd with your number parameter, or use the MCP tool in supported editors. Returns boolean true for odd numbers, false for even.
Yes, it handles negative integers correctly (-3 returns true, -4 returns false). For decimals, it typically evaluates the integer portion or may return false depending on implementation.
Absolutely. AI agents in Cursor, Windsurf, and Cline can call this tool to filter arrays, implement alternating patterns, or validate user input requiring odd numbers.
is-odd encapsulates the modulo logic (n % 2 !== 0) in a clean API call, eliminating potential implementation errors and providing consistent results across different programming languages.
Very fast for individual calls, but for bulk operations consider batching requests or using local modulo operations. Best for occasional checks or when you need guaranteed deterministic behavior.