Calculation methods
Every calculator uses a stated formula. Calculations run in your browser; entering a value does not send that number to a calculation server.
Precision and rounding
We use decimal arithmetic with 50 significant digits internally. Inputs are limited to 30 significant digits and absolute values from 10⁻²⁰ to 10³⁰, plus zero. Display precision can be set from 0 to 12 decimal places using the available presets. Rounding uses half-up: a tie rounds away from zero. Intermediate steps are not rounded to the display setting.
Very small and large results use scientific notation. A displayed step may contain an approximation; the next step uses the unrounded internal value. Ratio simplification, scaling and equivalence checks use integer arithmetic after decimal terms are normalized. Splitting a total allocates each share using the sum of ratio parts. Fraction arithmetic uses integer arithmetic to produce exact reduced terms. Fraction inputs can include an optional whole-number part; negative mixed numbers use a negative whole-number field. Fraction addition and subtraction use a least common denominator; multiplication uses the product of numerators and denominators; division multiplies by the reciprocal. Mixed-number, decimal and percentage forms are derived from the exact fraction. Only the displayed decimal and percentage are rounded.
Square-root calculations
Integer perfect-square checks and neighboring integer-square bounds use exact BigInt arithmetic. Decimal square-root approximations use decimal.js with the site’s 50-significant-digit working precision; the selected display precision does not change the internal calculation. Integer radicals are factored for simplified exact forms only up to radicands of 10¹². Above that limit, the exact radical is preserved without claiming it is fully simplified. A negative real radicand has no real square root; its principal complex square root is i√|x|. The symbol √x denotes the principal root, while the equation y² = x has two real solutions when x is positive.
Definitions
Percent change uses a positive starting value as its denominator. Percentage difference uses the average of two nonnegative measurements. They answer different questions. A move from 5% to 6% is one percentage point and a 20% relative increase.
Undefined calculations
We do not substitute zero for division by zero. Negative baselines are rejected for percent change, and negative measurements are rejected for percent difference. Each calculator explains its own domain. A 100% discount cannot be reversed to a unique original price.
Validation
Automated tests cover worked examples, invalid input, zero denominators, signed inputs, exact fraction operations, simplification, mixed-number formatting, successive discounts, decimal ratios, ratio scaling, exact ratio comparison, proportional splitting and algebraic properties. These checks reduce errors but do not replace checking a result in its real context.
Verification examples
These cases are checked by the automated test suite against the same calculation code used by the site. Open the linked calculator, choose the listed mode and enter the inputs in the listed order. Set the display precision to the number shown; rejected cases must display an error rather than a numeric result.
| Case and calculator | Mode; inputs in order | Decimal places | Expected result |
|---|---|---|---|
| Zero percentage | Percentage of a number: 0; 240 | 6 | 0 |
| Percentage above 100% | What percent is A of B?: 120; 80 | 6 | 150% |
| Negative result | Percentage of a number: -25; 80 | 6 | -20 |
| Find the whole | Find the original whole: 15; 54 | 6 | 360 |
| Positive half-up rounding | Percentage of a number: 15; 1.5 | 2 | 0.23 |
| Negative half-up rounding | Percentage of a number: -15; 1.5 | 2 | -0.23 |
| Known salary increase | Increase by a percentage: 2400; 5 | 6 | 2520 |
| Change crossing zero | Old value → new value: 10; -5 | 6 | -150% |
| Symmetric difference | Compare two measurements: 48; 52 | 6 | 8% |
| Successive discounts | Two successive discounts: 200; 25; 10 | 6 | 135 |
| Decimal ratio | Simplify A : B: 1.5; 2.5 | 6 | 3 : 5 |
| Recipe scaling | Solve A / B = x / D: 200; 4; 6 | 6 | 300 |
| Scale an equivalent ratio | Scale A : B by a factor: 2; 3; 4 | 6 | 8 : 12 |
| Compare equivalent ratios | Compare A : B with C : D: 3; 4; 6; 8 | 6 | Equivalent ratios |
| Compare different ratios | Compare A : B with C : D: 3; 4; 6; 9 | 6 | Not equivalent |
| Split a total by ratio | Split a total using A : B: 100; 2; 3 | 6 | 40 and 60 |
| Scale factor must be positive | Scale A : B by a factor: 2; 3; 0 | 6 | Rejected: nonpositive scale factor |
| Reject zero ratio in comparison | Compare A : B with C : D: 0; 0; 3; 4 | 6 | Rejected: first ratio is 0:0 |
| Reject zero split parts | Split a total using A : B: 100; 0; 0 | 6 | Rejected: zero total ratio parts |
| Zero whole | What percent is A of B?: 4; 0 | 6 | Rejected: zero denominator |
| Zero change baseline | Old value → new value: 0; 5 | 6 | Rejected: starting value must be positive |
| Both measurements zero | Compare two measurements: 0; 0 | 6 | Rejected: average is zero |
| Reverse 100% discount | Recover original price: 0; 100 | 6 | Rejected: no unique original price |
| Fraction addition | Add fractions (a/b + c/d): ; 1; 2; ; 1; 3 | 6 | 5/6 |
| Fraction subtraction below zero | Subtract fractions (a/b − c/d): ; 1; 4; ; 1; 2 | 6 | -1/4 |
| Fraction multiplication and mixed number | Multiply fractions (a/b × c/d): ; 2; 3; ; 9; 4 | 6 | 3/2 |
| Fraction division | Divide fractions (a/b ÷ c/d): ; 5; 8; ; 15; 16 | 6 | 2/3 |
| Mixed-number addition | Add fractions (a/b + c/d): 1; 1; 2; ; 2; 3 | 6 | 13/6 |
| Simplify fraction with negative denominator | Simplify one fraction: ; -18; -24 | 6 | 3/4 |
| Reject zero fraction denominator | Add fractions (a/b + c/d): ; 1; 0; ; 1; 3 | 6 | Rejected: zero denominator |
| Reject division by zero fraction | Divide fractions (a/b ÷ c/d): ; 1; 2; ; 0; 3 | 6 | Rejected: division by zero fraction |
| Square root of zero | Principal square root: 0 | 6 | 0 |
| Square root of one | Principal square root: 1 | 6 | 1 |
| Square root of nine is exact | Principal square root: 9 | 6 | 3 |
| Square root of two is approximate | Principal square root: 2 | 6 | 1.414214 |
| Simplified square root of 72 | Principal square root: 72 | 6 | 8.485281 |
| Square root of decimal quarter | Principal square root: 0.25 | 6 | 0.5 |
| Square root of decimal 2.25 | Principal square root: 2.25 | 6 | 1.5 |
| Square root of 12.5 | Principal square root: 12.5 | 6 | 3.535534 |
| Negative nine principal complex root | Principal square root: -9 | 6 | No real square root |
| Negative 72 principal complex root | Principal square root: -72 | 6 | No real square root |
| Square root at global upper limit | Principal square root: 1e30 | 6 | 1.000000e+15 |
| Square root at global lower limit | Principal square root: 1e-20 | 6 | 1.000000e-10 |
| Reject empty square root input | Principal square root: | 6 | Rejected: empty input |
| Reject malformed square root input | Principal square root: abc | 6 | Rejected: malformed number |
| Reject comma separator in square root input | Principal square root: 1,000 | 6 | Rejected: use decimal point |
| Reject square root above global limit | Principal square root: 1e31 | 6 | Rejected: above 1e30 |
| Reject square root below global limit | Principal square root: 1e-21 | 6 | Rejected: below 1e-20 |
For the successive-discount case, the first price reduction is 50 and the second is 15. Total savings are 65, equivalent to 32.5% of the starting price. Passing these checks is evidence of the tested cases, not a guarantee for every use.
Content responsibility
Calcunora maintains the calculation code, explanations and examples. To report a discrepancy, email info@calcunora.com with the calculator, mode, input values, precision and expected result.
Formula references
For independent educational context: Math Is Fun: percentages and OpenStax: applications of percent. The explanations and examples on Calcunora are written for this project.
Last content update: .