Calculate base-10 logarithms with precise floating-point accuracy. Use via MCP in Cursor or Windsurf for mathematical computations, or call GET /v1/math/log10?value=100 directly. Returns exactly 2.0 for input 100, avoiding JavaScript's floating-point quirks. Essential for scientific calculations, decibel conversions, and pH computations where precision matters.
curl "https://tinyfn.io/v1/math/log10" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/math/log10', {
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/log10',
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"
}
}
}
}
Calculates base-10 logarithm (log₁₀). TinyFn provides consistent precision across platforms, avoiding JavaScript's occasional floating-point inconsistencies that can affect scientific calculations.
The AI agent calls the log10 tool directly with your number. Just ask 'what's log10 of 1000' and get the precise result without writing code.
Returns an error for zero or negative inputs, since log₁₀(0) is undefined and log₁₀(negative) produces complex numbers not supported by this function.
Yes, use the change of base formula: log₁₀(x) = ln(x) / ln(10). However, calling log10 directly gives more accurate results than manual conversion.
log10 specifically uses base 10 (common logarithm), while 'log' typically means natural logarithm (base e). Use log10 for scientific notation, decibels, and pH calculations.