Math Utilities

Is Between

Validates whether a number falls within specified bounds using precise mathematical comparison. Access via MCP in Cursor or Windsurf, or call GET /v1/math/is-between with parameters. Returns boolean true/false with configurable inclusive/exclusive boundaries. Eliminates floating-point comparison errors that plague manual range checks.

API Endpoint

GET /v1/math/is-between

Code Examples

curl "https://tinyfn.io/v1/math/is-between" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/is-between', {
  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-between',
    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 between two values inclusively?

Set inclusive=true (default) when calling is-between. For example, checking if 5 is between 1 and 10 inclusively returns true.

What's the difference between inclusive and exclusive bounds?

Inclusive bounds include the boundary values (≤, ≥), while exclusive bounds exclude them (<, >). Use inclusive=false for exclusive checking.

Can I use this MCP tool for validating user input ranges?

Yes, AI agents can call is-between to validate inputs like ages (18-65), percentages (0-100), or temperature ranges before processing.

Does is-between handle floating-point precision issues?

Yes, it uses proper numeric comparison that avoids common floating-point arithmetic errors that occur with manual range checking.

What happens if the lower bound is greater than the upper bound?

The function will return false since no number can logically fall within an invalid range where min > max.

Try Is Between Now

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

Get Free API Key