Math Utilities

Is Zero

Check if a number equals exactly zero with precise floating-point handling. Use via MCP in Cursor or Windsurf, or call GET /v1/math/is-zero directly. Returns boolean true/false for any numeric input. Handles edge cases like -0.0, scientific notation, and floating-point precision that simple equality checks miss.

API Endpoint

GET /v1/math/is-zero

Code Examples

curl "https://tinyfn.io/v1/math/is-zero" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/is-zero', {
  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-zero',
    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 does is-zero handle floating-point precision issues?

It performs exact zero comparison, distinguishing between 0.0 and values like 1e-15 that appear zero but aren't mathematically zero.

Does is-zero treat -0.0 and +0.0 as zero?

Yes, both positive and negative zero return true, following IEEE 754 standards for zero equality.

Can I use is-zero in MCP-enabled editors for code validation?

Absolutely — AI agents in Cursor, Windsurf, or Cline can call is-zero to verify calculations or validate numeric inputs in your code.

What input formats does is-zero accept?

It accepts integers, decimals, and scientific notation (like 0e10) as query parameters or JSON payload.

Why use is-zero instead of simple == 0 comparison?

It provides deterministic results across languages and handles edge cases consistently, preventing bugs from language-specific zero comparison quirks.

Try Is Zero Now

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

Get Free API Key