Determines whether a number is a perfect square (like 9, 16, 25) with mathematical precision. Use via MCP in Cursor or Windsurf for instant validation, or call GET /v1/math/is-perfect-square with your number. Returns boolean true/false plus the square root when applicable. Handles edge cases like negative numbers and decimals correctly.
curl "https://tinyfn.io/v1/math/is-perfect-square" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/is-perfect-square', {
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-perfect-square',
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"
}
}
}
}
Call the is-perfect-square tool with your number. It returns a boolean result plus the square root if true.
Positive integers whose square root is also an integer: 1, 4, 9, 16, 25, etc. Zero is considered a perfect square (0²=0).
No, negative numbers cannot be perfect squares since square roots of negatives aren't real numbers in standard math.
Yes, but they're rarely perfect squares. The tool handles decimals but will return false for most non-integer inputs.
The tool handles very large integers efficiently, but extremely large numbers may hit practical limits depending on precision requirements.
Get your free API key and start using Is Perfect Square in seconds.
Get Free API Key