Skip to main content

Math Helpers

The small operations that homework, exams, and everyday estimates keep asking for, gathered on one page: a percentage of a number, powers, square and cube roots, factorials, the three common logarithms, least common multiples, greatest common factors, and a prime check. Pick the operation, enter the numbers, and read the result with its working.

Four of these are computed exactly — percentages, factorials, LCM, and GCF never come back rounded — and the rest follow the display rule stated below, so you always know which digits are exact and which are the last ones shown.

Result

37.5

How it is worked out

  1. 15% of 250 = 250 × 15 ÷ 100 = 37.5.
  2. Computed exactly — the percentage and the number are kept as exact fractions until the final printed digit.

Embed this calculator on your website →

The formula

percentage of = number × percentage ÷ 100

n! = 1 × 2 × … × n · log_b(x) = the power b must reach to give x

  • exact operations — percentage-of, integer powers, factorials, LCM, and GCF are computed as exact fractions or integers (LCM/GCF via Euclid's algorithm; signs are ignored, and GCF(0, 0) is refused as undefined rather than guessed).
  • prime check — deterministic Miller-Rabin, valid for every input below 2^64; larger inputs get an honest out-of-range refusal, not a maybe.
  • display rule for the rest — roots, non-integer powers, and logarithms are shown rounded half-up to 10 decimal places, trailing zeros trimmed; a result that lands on a whole number prints as one.
  • 0^0 — has no value forced by the rules of powers; like most calculators this tool adopts the convention 0^0 = 1, and the result says so rather than hiding it.

Worked example: 15% of 250 = 250 × 15 ÷ 100 = 37.5 — the default in the tool above, exact to the last digit.

How it works

Powers. An integer exponent means repeated multiplication (2^10 = 1024) and is done exactly, including negative exponents as reciprocals (5^−2 = 1/25 = 0.04). A fractional exponent is a root in disguise — 9^0.5 is the square root of 9, exactly 3 — and is computed in decimal arithmetic under the 10-decimal display rule.

Factorials grow violently. 20! is already 2,432,902,008,176,640,000 — exact here, because the integer is kept whole rather than rounded into scientific notation. The cap of 500 exists only because beyond it the exact answer runs to thousands of digits.

Logarithms answer "to what power?" log₁₀(1000) = 3 because 10³ = 1000; log₂(1024) = 10 because 2¹⁰ = 1024. ln is the same question for the constant e. That is why logarithms of numbers below 1 are negative (log₂(0.5) = −1), and why 0 and negative numbers have no logarithm at all — no power of a positive base reaches them.

Examples

  • 7.5% of 80 = 6 — exact, no decimal dust.
  • √2 ≈ 1.4142135624 — the 10-decimal display of an irrational number.
  • ∛100 ≈ 4.6415888336; ∛27 = 3 exactly, and ∛−27 = −3 (cube roots accept negatives).
  • log₁₀(2) ≈ 0.3010299957 — the most useful logarithm in estimation work.
  • LCM(12, 18) = 36, GCF(12, 18) = 6 — exact, Euclid all the way down.
  • 97 is prime; 561 is not (a Carmichael number — it fools the simple Fermat test, not the one used here).

Frequently asked questions

Why do percentages and factorials show every digit, but roots stop at 10 decimals?

Because the first two have finite exact answers and the rest usually do not. √2's decimal expansion never ends or repeats, so any tool must choose where to stop — this one states its choice (10 decimal places, half-up) instead of silently printing whatever a floating-point display happens to show.

Why is 0! equal to 1?

By definition — the empty product. It is the convention that makes the counting formulas work: there is exactly one way to arrange zero objects. The tool states the definition in its working whenever you ask for 0!.

What is the difference between log, ln, and log₂?

Only the base. log (here log₁₀) asks '10 to what power?', ln asks the same for e ≈ 2.71828, and log₂ for 2 — common in computing, where 2¹⁰ = 1024 is the reason a 'kilobyte' era began. Same question, three bases; the operation names its base on the page.

How does the prime check work, and why the 2^64 limit?

It uses the Miller-Rabin test with the first twelve prime bases, which mathematicians have proven correct for every number below about 3.2×10^23 — comfortably covering everything under 2^64. Above that bound the test could theoretically err, so instead of risking a wrong 'prime', the tool refuses with an honest out-of-range message. Inside the range the answer is certain, not probable.

Why won't it take the logarithm of 0 or a negative number?

Because no real power of 10, e, or 2 ever reaches 0 or a negative value — the answer does not exist in real numbers. The tool refuses with the reason rather than printing an error code or a silent blank, the same way it refuses the square root of a negative.