Math Utilities

Power

Computes mathematical exponentiation with arbitrary precision — base^exponent for any real numbers. Access via `/v1/math/power` REST endpoint or MCP in Cursor and other AI editors. Example: 2^10 = 1024. Handles edge cases like fractional exponents and negative bases that often trip up manual calculations.

API Endpoint

GET /v1/math/power

Code Examples

curl "https://tinyfn.io/v1/math/power" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/power', {
  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/power',
    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 calculate powers with decimal exponents?

The power tool handles fractional exponents like 8^(1/3) = 2 or 16^0.5 = 4. Just pass the decimal value as the exponent parameter.

What happens with negative bases and fractional exponents?

Results depend on the specific values. (-8)^(1/3) works, but (-4)^0.5 returns an error since it would produce a complex number.

Can MCP agents use this for compound interest calculations?

Yes, perfect for financial formulas. An agent can calculate compound interest using (1 + rate)^time without floating-point precision issues.

How does this compare to programming language pow() functions?

Provides consistent results across platforms and handles edge cases uniformly. Languages vary in their pow() implementations, especially for special values.

What's the maximum exponent size supported?

Supports very large exponents within reasonable computational limits. Extremely large results may be returned in scientific notation.

Try Power Now

Get your free API key and start using Power in seconds.

Get Free API Key