Compare decimal numbers with mathematically correct results and detailed explanations. Access via MCP in Cursor or Windsurf, or call GET /v1/math/compare-decimals directly. Handles tricky cases like 0.9 vs 0.11 (returns "greater than") that confuse string-based comparisons. Returns comparison result, numerical difference, and step-by-step reasoning.
curl "https://tinyfn.io/v1/math/compare-decimals" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/compare-decimals', {
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/compare-decimals',
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"
}
}
}
}
The tool uses precise decimal arithmetic to avoid floating point errors. It correctly compares values like 0.1 + 0.2 vs 0.3 without precision loss that plagues standard programming comparisons.
Returns JSON with comparison result ("greater", "less", "equal"), numerical difference, and detailed explanation of the comparison logic used.
Yes, handles negative numbers (-0.5 vs -0.25) and scientific notation (1.5e-3 vs 0.0015). All standard decimal formats are supported including very large and very small numbers.
Simply ask your AI agent to compare two decimal values. The MCP tool provides accurate results with explanations, perfect for financial calculations or data validation workflows.
Language operators can fail with floating point precision issues and don't provide explanations. This tool ensures mathematical accuracy and gives detailed reasoning for the comparison result.
Get your free API key and start using Compare Decimals in seconds.
Get Free API Key