Power & Exponent Calculator
Calculate mathematical powers and modular exponentiation with step-by-step breakdowns.
Updated
What is the Power & Exponent Calculator?
The Power & Exponent Calculator evaluates powers with positive, negative, and fractional exponents, and calculates modular exponentiation. It is useful for checking algebra and exploring the arithmetic used in computer science.
For non-negative safe-integer bases and integer exponents up to 3,000, it can show an exact integer result. Other powers use standard floating-point calculations, and the tool also displays scientific and engineering notation.
The Modular Exponentiation mode uses the square-and-multiply method to calculate expressions in the form of be(modm). This is an educational calculator, not an encryption or key-generation tool.
Key Features:
- Instant Evaluation: Calculate standard powers (bx) with support for fractional, negative, and decimal exponents.
- Exact integer output: View every digit of supported non-negative integer powers, such as 21000.
- Step-by-Step Breakdown: Understand exactly how a fractional, negative, or integer exponent is mathematically resolved using algebraic properties.
- Modular Exponentiation Mode: Calculate examples such as 53(mod13) with a step-by-step log.
- Interactive Adjustments: Use the live slider to seamlessly shift exponent values up and down, exploring how powers geometrically scale.
How it works
The calculator operates using two distinct computational engines depending on your selected mode: Standard Power and Modular Exponentiation.
1. Standard Power (bx)
Exponentiation is a mathematical operation involving a base (b) and an exponent (x). The fundamental rule changes depending on the nature of the exponent:
- Positive Integers: Exponentiation corresponds to repeated multiplication.
- bx=b×b×⋯×b (x times)
- Negative Exponents: A negative exponent is defined as the reciprocal of the base raised to the absolute value of the exponent.
- b−x=bx1
- Fractional (Rational) Exponents: Fractional exponents represent roots. The calculator uses a continuous fraction algorithm to convert decimals like
0.5into fractions like1/2. - bm/n=nbm
- The Zero Rule: Any non-zero base raised to the power of 0 is strictly 1. (b0=1).
For non-negative safe-integer bases and integer exponents up to 3,000, the calculator also uses BigInt to provide an exact integer result. The standard numeric result and powers outside this range use floating-point arithmetic.
2. Modular Exponentiation (be(modm))
Calculating be(modm) directly by first finding be and then finding the remainder is practically impossible for large cryptographic values, as be becomes unimaginably huge and causes memory overflow.
Instead, this tool uses the Right-to-Left Square-and-Multiply Algorithm, keeping the numbers strictly bounded by the modulus m at every single step:
- Initialize a
result = 1, and set the initial base valuecurrent_base = b % m. - Convert the exponent e into its binary representation.
- Loop through the binary bits of the exponent:
- If the current bit is
1(odd), multiply theresultby thecurrent_base, then modulo m. - Square the
current_baseand modulo m. - Shift the exponent right (divide by 2).
- The loop terminates when the exponent reaches 0, returning the remainder. This calculator demonstrates the arithmetic; it does not perform encryption or provide cryptographic security.
Examples
Standard Exponentiation
Calculate a base raised to a positive integer exponent.
Base: 2, Exponent: 101024Fractional Exponent
Calculate the square root of a number using a decimal exponent.
Base: 16, Exponent: 0.54Negative Exponent
Find the reciprocal power of a base number.
Base: 5, Exponent: -20.04 (or 1/25)Modular Exponentiation
Calculate the remainder of a large power using a modulus.
Base: 5, Exponent: 3, Modulus: 138Frequently asked questions
What happens if I calculate 0 to the power of 0?
What happens if I calculate 0 to the power of 0?
In mathematics, 00 is considered an "indeterminate form." While some fields of discrete mathematics and combinatorics define 00=1 for convenience, in standard calculus and algebra, it remains undefined. This calculator will throw a mathematically sound error explaining this limitation if you attempt to calculate it.
How does the calculator handle negative exponents?
How does the calculator handle negative exponents?
A negative exponent denotes the reciprocal of the base raised to the corresponding positive exponent. For example, if you input 5−2, the calculator evaluates it as 1/(52), which is 1/25, resulting in exactly 0.04. The step-by-step breakdown window will display this exact algebraic property.
What is modular exponentiation used for?
What is modular exponentiation used for?
Modular exponentiation calculates the remainder of a power after division by a modulus (be(modm)). It is one of the mathematical operations used in systems such as RSA and Diffie-Hellman, but this calculator only demonstrates the arithmetic; it does not encrypt data or securely generate shared secrets.
Can this calculator handle extremely large numbers?
Can this calculator handle extremely large numbers?
For non-negative safe-integer bases and integer exponents up to 3,000, the calculator can display an exact BigInt result. Other powers use floating-point arithmetic and may be rounded.
Why does a negative base with a fractional exponent cause an error?
Why does a negative base with a fractional exponent cause an error?
If you try to calculate something like (−4)0.5, it translates to the square root of −4. The square root of a negative number is not a real number; it is an imaginary/complex number (in this case, 2i). Because this calculator operates on the real number line, it will reject negative bases combined with even-denominated fractional exponents.
Related tools
More utilities you might find handy.
Circle Calculator
Calculate circle radius, diameter, circumference, and area from any one known value. Instant results with adjustable precision.
Cube Root Calculator
Calculate cube root of any number
Decimal & Base Converter
Instantly convert numbers between decimal, binary, hexadecimal, octal, and any custom base from 2 to 36.