HomeMathematics & Algebra Tools4 Function Calculator with Steps | Free Basic Calculator

4 Function Calculator with Steps | Free Basic Calculator

4 Function Calculator

A free basic 4 function calculator that adds, subtracts, multiplies and divides, with square root, percent and memory keys. Type or tap a calculation and get the exact answer, every step, a check, and the answer a left-to-right calculator would show.

ArithmeticStep by StepExact AnswerOrder of OperationsMemory KeysFree

⚡ 0. Quick Answer

A 4 function calculator is a basic calculator that does four operations: addition (+), subtraction (−), multiplication (×) and division (÷), usually with √, % and memory keys.

Worked example: 125 + 37 × 4 − 18 ÷ 3 = 125 + 148 − 6 = 267. Pressed key by key on a basic calculator that works left to right, the same keys give 210.

Brackets → × and ÷ (left to right) → + and − (left to right)

Rule of thumb: a basic 4 function calculator does each key at once, so 2 + 3 × 4 shows 20, not 14. Do the × and ÷ parts first, or use the M+ key, to get the textbook answer.

Key Takeaways

  • A 4 function calculator has exactly 4 operations: +, −, × and ÷, plus helper keys such as √, %, ± and M+.
  • Most basic models work left to right, so 2 + 3 × 4 = 20 on them but 14 with the order of operations.
  • Division by 0 has no answer, so every calculator shows E or Error.
  • The percent key adds a share of the running total: 250 + 18% = 295.
  • College Board allows a 4-function calculator with square root on AP Biology and AP Environmental Science.

📚 1. What Is a 4 Function Calculator?

A 4 function calculator is the simplest kind of electronic calculator. It does the four basic operations of arithmetic: addition, subtraction, multiplication and division. That is where the name comes from. You may also see it written as a 4-function calculator, a four-function calculator or a basic calculator.

Most models add a few helper keys. The √ key takes a square root. The % key works out percentages. The ± key changes the sign. The memory keys (MC, MR, M−, M+) store a number while you work on something else. A 4 function calculator has no powers, no sin or cos, no logs and no graphs. Those belong to scientific and graphing calculators.

Used for: shopping bills, splitting a restaurant bill, sales tax, discounts, checking homework, measuring for DIY jobs, cash counting and simple lab work. A worked one-liner: three items at 4.99, 12.50 and 3.75 plus a 0.89 bag cost 4.99 + 12.50 + 3.75 + 0.89 = 22.13.

Who uses it: primary and middle school students (Grades 3 to 8), students sitting exams that only allow a basic calculator, cashiers, teachers marking work, and anyone who wants a fast answer without menus. College Board lets students bring a 4-function calculator to AP Macroeconomics, AP Microeconomics and AP Business with Personal Finance, and a 4-function calculator with a square root key to AP Biology and AP Environmental Science (policy checked October 2026).

1.1 4 function vs scientific vs graphing calculator

Feature4 function calculatorScientific calculatorGraphing calculator
Operations+ − × ÷, often √ and %All of those plus powers, roots, logs, sin, cos, tanAll scientific functions plus graphs and programs
Order of 2 + 3 × 4Usually left to right: 20Order of operations: 14Order of operations: 14
BracketsUsually noneYesYes
Screen8 to 12 digits, one lineTwo lines or natural displayFull graph screen
Typical price (USD)2 to 1010 to 2590 to 160
Best forMoney, quick sums, basic-calculator examsAlgebra, science, A level and SATFunctions, calculus, statistics
Wins whenSpeed and simplicity matterYou need powers or bracketsYou need to see a graph
Diagram of a basic 4 function calculatorA calculator with a one-line screen, memory keys, clear key, digit keys, the four operation keys, square root, percent and an equals key.267MMCMRM−M+C√%÷789×456−123+±0.=Screen: 8 to 12 digitsMemory keysClear, root, percentThe four functionsEqualsSign change ±
The parts of a basic 4 function calculator. Operation keys are blue, memory keys are purple, the clear key is pink and the equals key is green.

🧮 2. Enter Your Calculation

STATS UNLOCK · 4 FUNCTIONExact mode
0
BODMAS

Paper tape (history)

    Key guide

    • × ÷ or type * and /
    • √ or type sqrt
    • 250 + 18% adds 18% of 250
    • ± flips the last number
    • M+ / M− add the answer to memory
    • MR puts the memory back in
    • Enter or = calculates
    • 1,250 commas for thousands are fine

    Teachers use this to build an answer key: paste a worksheet, press Calculate, then Download Doc gives every answer with its working. Lines that start with # are skipped.

    📊 3. Results and Step-by-Step Solution

    Answer
    ___
    Press Calculate to see the exact answer, the decimal answer and every step.

    🧠 4. Understanding Your Answer, In Detail

    4.1 What your answer means

    ___ Solve a problem above.

    4.2 Does the calculation order change it?

    ___ Solve a problem above.

    This is the most common surprise with a basic calculator. Cheap 4 function calculators use immediate execution: each operation is carried out the moment you press the next operation key. So 2 + 3 × 4 becomes 5 × 4 = 20. School maths, scientific calculators, Excel, R and Python all follow the order of operations instead, which gives 2 + 12 = 14. Neither calculator is broken. They follow different rules, and the tool shows you both.

    4.3 Exact answer or decimal?

    ___ Solve a problem above.

    A fraction becomes a decimal that stops (terminates) only when its bottom number, in lowest terms, has no prime factors except 2 and 5. So 3/8 = 0.375 stops, but 1/3 = 0.333... and 1/7 = 0.142857142857... go on forever. A calculator screen cuts these off, which is why 1 ÷ 3 × 3 can show 0.9999999 on a cheap model. This tool keeps the exact fraction, so it gives exactly 1.

    4.4 How to check the answer yourself

    ___ Solve a problem above.

    Every operation has an opposite: + is undone by −, and × is undone by ÷. If 148 ÷ 4 gives back 37, then 37 × 4 = 148 was right. A second quick check is estimation: round each number and work it out in your head. 125 + 37 × 4 − 18 ÷ 3 is close to 120 + 40 × 4 − 6 = 274, so 267 is believable and 2,670 is not.

    4.5 Exact arithmetic vs ordinary floating point

    ___ Solve a problem above.

    4.6 What the charts show

    Chart 1 shows the result of each step in the order it was done. In left-to-right mode this is the running total a basic calculator holds. Chart 2 shows every number you typed, with negative numbers below the line. Chart 3 compares three ways of working out the same keys: the order of operations, a left-to-right basic calculator, and a typical computer program. Chart 4 counts how many of each operation the calculation needed.

    4.7 Special and impossible cases

    CaseExampleAnswerWhy
    Divide by zero45 ÷ 0Undefined (E)No number times 0 gives 45
    Zero divided by a number0 ÷ 4500 × 45 = 0, so it works
    Square root of a negative√(−9)Not a real number (E)Any real number squared is 0 or more
    Two negatives multiplied−15 × −230Negative times negative is positive
    Subtracting a negative9 − (−30)39Taking away a debt adds
    Answer too long for the screen987654321 × 123456789121,932,631,112,635,269An 8-digit screen shows E; this tool shows all 18 digits

    4.8 What research says about calculators and these mistakes

    Using a calculator does not weaken basic skills when it is part of teaching: a meta-analysis of 54 studies found that students' operational and problem-solving skills improved when calculators were used in both instruction and tests (Ellington, 2003), and an earlier review of 79 studies reached a similar result for most grades (Hembree & Dessart, 1986). The order of operations is a real stumbling block even for adults. In a study of 381 future elementary teachers, many did multiplication before division and addition before subtraction, reading PEMDAS literally instead of working left to right (Glidden, 2008). Division by zero causes similar trouble: some teachers of Grades 4 to 8 did not know it is undefined, and others knew but could not explain why (Quinn et al., 2008). Finally, ordinary computer arithmetic stores decimals in binary, so 0.1 + 0.2 is not exactly 0.3 (Goldberg, 1991). That is why this tool uses exact fractions instead.

    4.9 Where this leads next

    Once the four operations are automatic, the next topics are fractions and mixed numbers, percentages, averages, and then powers and roots on a scientific calculator. A mean is just addition followed by one division, so the mean calculator is a natural next step.

    ✍ 5. How to Write the Answer

    Five ready-to-copy versions of your answer. They fill in after you press Calculate.

    Exam or homework answer (full working)
    ___ Solve a problem above to fill this card.
    Conventions

    Write one operation per line. Show the × and ÷ lines before the + and − lines. Underline or box the final answer. Markers give method marks for the lines even if the last number slips.

    Final answer only
    ___ Solve a problem above to fill this card.
    Conventions

    Give money to 2 decimal places. Give a repeating decimal either as a fraction or rounded to the places the question asks for, and say "to 2 d.p." or "to 3 s.f.".

    Teacher's answer key line
    ___ Solve a problem above to fill this card.
    Conventions

    Add the left-to-right wrong answer to the key. It tells you at once which students pressed the keys in order on a basic calculator.

    Report or lab write-up sentence
    ___ Solve a problem above to fill this card.
    Conventions

    Keep full precision in the working and round only the reported value. Say which rounding you used.

    Plain text for a forum, chat or spreadsheet
    ___ Solve a problem above to fill this card.
    Conventions

    Uses * for times, / for divide and sqrt() for the root, so it pastes cleanly into any text box, Excel cell or code editor.

    ∑ 6. Formulas Used

    These are the rules the 4 function calculator applies, with the worked example 125 + 37 × 4 − 18 ÷ 3 = 267 where it fits.

    ①
    Order of Operations (BODMAS / PEMDAS)
    Brackets → √ and % → × ÷ (left to right) → + − (left to right)
    B / PBrackets (parentheses): work these out first
    D MDivision and multiplication: same rank, done left to right
    A SAddition and subtraction: same rank, done left to right
    Example125 + 37 × 4 − 18 ÷ 3 = 125 + 148 − 6 = 267
    NoteMost basic calculators skip this rule and work left to right, giving 210
    ②
    Addition and Subtraction
    a + b = c   ⇔   c − b = a
    a, bAny real numbers, positive, negative or decimal
    cThe sum (for +) or the difference (for −)
    Rulea − (−b) = a + b: subtracting a negative adds
    Example125 + 148 = 273, check 273 − 148 = 125
    ③
    Multiplication and Division
    a × b = c   ⇔   c ÷ b = a   (b ≠ 0)
    a, bReal numbers. For division, b is the divisor and must not be 0
    cThe product (for ×) or the quotient (for ÷)
    SignsSame signs give a positive answer, different signs give a negative answer
    Example37 × 4 = 148, check 148 ÷ 4 = 37; 18 ÷ 3 = 6, check 6 × 3 = 18
    ④
    The Percent Key
    a + b% = a × (1 + b ÷ 100)    a − b% = a × (1 − b ÷ 100)    a × b% = a × b ÷ 100
    aThe base amount, for example a price or a bill
    bThe percentage, for example 18 for 18%
    Example250 + 18% = 250 × 1.18 = 295 (bill plus tip)
    NoteBrands differ for a ÷ b%. This tool uses a ÷ (b ÷ 100)
    ⑤
    Square Root Key
    √x = r   where   r × r = x  and  r ≥ 0
    xA number that is 0 or more (the radicand)
    rThe principal (non-negative) square root
    Example√81 = 9 because 9 × 9 = 81; √2 ≈ 1.41421356 never ends
    Range√ of a negative number is not real, so the screen shows E
    ⑥
    Division by Zero Rule
    a ÷ 0 is undefined    0 ÷ a = 0  (a ≠ 0)
    aAny number
    ReasonIf a ÷ 0 = q, then q × 0 = a. But q × 0 is always 0, so no q exists
    ScreenE, Error, or Cannot divide by zero
    ⑦
    Rounding to n Decimal Places
    round(x, n) = (x × 10n rounded to a whole number) ÷ 10n
    xThe exact answer
    nThe number of decimal places you want, a whole number 0 or more
    RuleA 5 rounds away from zero (2.5 → 3), the same as Excel ROUND
    Example1 ÷ 7 = 0.142857... → 0.1429 to 4 decimal places

    🔀 7. 4 Function Calculator Flowchart, Step by Step

    This flowchart shows how a 4 function calculator problem is worked out step by step with the order of operations. Every box uses the same worked example as the Excel, R, Python and by-hand sections: 125 + 37 × 4 − 18 ÷ 3.

    Start or result Data step Calculation step Yes or no check
    StartA calculation with more than one operation125 + 37 × 4 − 18 ÷ 3
    1
    Read the operations from left to right+ then × then − then ÷: four operations, five numbers
    CheckAre there any brackets?
    NoNone here, so go straight to × and ÷.
    YesWork out each bracket first and write its answer in its place.
    2
    Mark every × and ÷37 × 4   and   18 ÷ 3These two are done before any + or −
    3
    Multiply37 × 4= 148
    CheckIs the divisor 0?
    NoThe divisor is 3, so carry on.
    Yes, stopDivision by 0 is undefined. The calculator shows E.
    4
    Divide18 ÷ 3= 6
    5
    Rewrite with the new numbers125 + 148 − 6Only + and − are left
    6
    Add, then subtract, left to right125 + 148 = 273; 273 − 6= 267
    CheckDoes each step undo back?
    Yes148 ÷ 4 = 37, 6 × 3 = 18, 267 + 6 = 273, 273 − 148 = 125.
    No, stopFind the step that does not undo and redo it.
    Result125 + 37 × 4 − 18 ÷ 3 = 267Whole number VerifiedPressed left to right on a basic calculator, the same keys give 210.

    Check any box yourself: the Excel sheet in Section 9, the R script in Section 10, the Python script in Section 11 and the written method in Section 14 all give 267 for this example.

    📝 8. How to Use This Calculator

    1. Type or tap your calculation. Use the keypad, or type into the screen with * for × and / for ÷.
    2. Or pick a sample problem. The Sample problem box has ten worked examples, from a shopping bill to the viral 6 ÷ 2 × (1 + 2).
    3. Choose the calculation order. Keep Order of operations for school maths, or pick Left to right to copy a basic calculator.
    4. Set the decimal places. Choose 2 for money, or 4, 6 or 10 for science and checking.
    5. Press Calculate or =. The Enter key works too.
    6. Read the answer box. It shows the exact answer, the decimal, the answer type and a Verified badge.
    7. Follow the steps. Each step names the rule it used and why it comes in that order.
    8. Use memory for long jobs. M+ adds the answer to memory, M− takes it away, MR puts it back, MC clears it.
    9. Paste many problems in Batch mode. One calculation per line, up to 500 lines.
    10. Download the working. Download Doc saves a text file with every step; Download PDF prints a clean copy.

    📈 9. How to Do 4 Function Calculations in Excel

    Excel is a 4 function calculator with a grid. It uses + and − as normal, * for × and / for ÷, and it always follows the order of operations. So the worked example gives 267, not the 210 a basic calculator shows when you press the keys in order.

    The whole thing in one cell: =125+37*4-18/3 returns 267. With the numbers in A2:A6, =A2+A3*A4-A5/A6 does the same.

    9.1 The functions you need

    You wantExcelNote
    Add, subtract, multiply, divide+ - * /Start every formula with =
    Add a whole column=SUM(A2:A20)Ignores text and blank cells
    Multiply a whole column=PRODUCT(A2:A6)Blank cells are skipped, not treated as 0
    Whole-number division=QUOTIENT(17,5)Returns 3, drops the remainder
    Remainder=MOD(17,5)Returns 2. Takes the divisor's sign with negatives
    Square root=SQRT(81)Returns #NUM! for a negative number
    Percent of a number=250*18%Returns 45. Excel reads 18% as 0.18
    Add a percent=250*(1+18%)Returns 295, the same as 250 + 18% on a calculator
    Round=ROUND(1/7,4)Returns 0.1429. Rounds a 5 away from zero
    Show as a fractionFormat Cells → FractionDisplays 0.375 as 3/8

    9.2 Step by step

    1 Type the whole calculation in one cell

    Click any cell, type the formula and press Enter. Excel applies × and ÷ before + and −, the same as this tool's default mode.

    =125+37*4-18/3
    Excel sheet: one-cell formula giving 267Spreadsheet with formula =125+37*4-18/3 in cell A1.Xorder.xlsx - ExcelA1fx=125+37*4-18/3ABC126723

    Cell A1 shows 267. The formula bar keeps the formula so you can edit it.

    2 Put the numbers in cells and refer to them

    Cell references let you change one number and see the answer update. This is how a shopping list or a budget works.

    =A2+A3*A4-A5/A6
    Excel sheet: cell references giving 267Spreadsheet with formula =A2+A3*A4-A5/A6 in cell C2.Xorder.xlsx - ExcelC2fx=A2+A3*A4-A5/A6ABC1NumberKeyAnswer2125+267337×44−518÷63

    With 125, 37, 4, 18, 3 in A2:A6, cell C2 gives 267.

    3 Copy a basic calculator with a running total

    To see what a left-to-right calculator does, build the running total one key at a time. Each cell uses the cell above it.

    =C2*A4=C3-A5
    Excel sheet: left to right running total ending at 210Spreadsheet with formula =C4/A6 in cell C5.Xorder.xlsx - ExcelC5fx=C4/A6ABC1NumberKeyRunning2125125337+16244×648518−63063÷210

    The running total goes 162, 648, 630, 210. The last cell is the 210 a basic calculator shows.

    4 Add up a bill with SUM and a percent

    For the shopping example, SUM adds the column and a second cell adds the tax or tip.

    =SUM(A2:A5)=B6*(1+18%)
    Excel sheet: shopping bill total 22.13 plus 18 percentSpreadsheet with formula =B6*(1+18%) in cell B7.Xbill.xlsx - ExcelB7fx=B6*(1+18%)AB1ItemPrice2Bread4.993Cheese12.504Fruit3.755Bag0.896Total22.137Plus 18%26.1134

    The four items total 22.13. Adding 18% gives 26.1134, which rounds to 26.11.

    9.3 The awkward cases

    • Long answers lose digits. Excel stores about 15 significant digits. 987654321 × 123456789 shows 1.21933E+17, and even with number format it ends in 000 instead of 269. This tool gives all 18 digits exactly.
    • Hidden decimal errors. =0.1+0.2 displays 0.3, but =0.1+0.2-0.3 shows 5.55E-17 instead of 0. Wrap money in ROUND before comparing values.
    • Percent typed as a number. 18 and 18% are different. =250*18 is 4,500; =250*18% is 45.
    • Text that looks like a number. A number pasted from a web page may be text. SUM skips it silently. Look for green triangles in the cell corner.

    9.4 Why Excel might disagree with a calculator, R or Python

    SituationWhat happensFix
    2+3*4 on a basic calculatorBasic calculator 20, Excel 14Use Excel's answer for school maths, or brackets: =(2+3)*4 for 20
    =-3^2Excel gives 9 (the minus is applied first); R, Python and paper give −9Write =-(3^2) or =0-3^2
    Rounding 2.5 to a whole numberExcel ROUND gives 3; R and Python round() give 2 (round half to even)Say which rule you used. This tool rounds half away from zero, like Excel
    =MOD(-7,3)Excel 2, R 2, Python 2, but C and JavaScript give −1Check the sign rule of the language you use
    0.1 + 0.2Excel shows 0.3 but stores 0.30000000000000004ROUND before comparing
    250 + 18% typed into ExcelExcel gives 250.18 (it adds 0.18)Write =250*(1+18%); a calculator's % key does this for you

    9.5 Charting it in Excel

    For a running total, select the step labels and the totals and choose Insert → Column chart. Then add the order-of-operations answer as a second series and change it to a line, so you can see where the left-to-right total drifts away. For values against a number scale, use Scatter with Straight Lines, never Line chart, because Line chart spaces the x values evenly whatever they are.

    9.6 Excel errors you will probably hit

    ErrorCauseFix
    #DIV/0!Dividing by 0 or by an empty cell=IFERROR(A2/B2,"") or fill the cell
    #VALUE!A cell holds text, such as "12 kg"Keep units in the header, numbers in the cells
    #NUM!SQRT of a negative numberUse ABS, or check the sign first
    #NAME?A typo in a function name, such as =SUMMRetype the name; Excel suggests it as you type
    ########The column is too narrow for the answerDouble-click the column edge to widen it

    📈 10. How to Do 4 Function Calculations in R

    R follows the order of operations, so 125 + 37 * 4 - 18 / 3 prints 267. The script below also copies a left-to-right basic calculator, prints both answers, checks every step with the opposite operation, and saves one 300 dpi chart.

    Copy the whole block. It runs top to bottom in RStudio, Posit Cloud or Rscript four_function.R. Change only the nums and ops lines to use your own calculation. MASS comes with every standard R install.

    10.1 The complete script

    R, base plus MASS, saves four_function_steps.png

    # ============================================================
    # 4 function calculator: order of operations vs left to right
    # StatsUnlock - https://statsunlock.com/4-function-calculator/
    # Base R plus MASS (MASS ships with every standard R install).
    # ============================================================
    
    # ---- 1. Your calculation (change these two lines) ----------
    nums <- c(125, 37, 4, 18, 3)
    ops  <- c("+", "*", "-", "/")
    
    expr_text <- paste0(nums[1], paste0(" ", ops, " ", nums[-1], collapse = ""))
    cat("Calculation:", expr_text, "\n")
    
    # ---- 2. Order of operations (R follows BODMAS / PEMDAS) ----
    bodmas <- eval(parse(text = expr_text))
    
    # ---- 3. Left to right, like a basic 4 function calculator --
    apply_op <- function(a, op, b) {
      switch(op,
             "+" = a + b,
             "-" = a - b,
             "*" = a * b,
             "/" = if (b == 0) stop("Division by zero is undefined") else a / b)
    }
    running <- numeric(length(ops))
    acc <- nums[1]
    for (i in seq_along(ops)) {
      acc <- apply_op(acc, ops[i], nums[i + 1])
      running[i] <- acc
    }
    left_to_right <- acc
    
    # ---- 4. Print the answers -----------------------------------
    cat("Order of operations answer:", format(bodmas, big.mark = ","), "\n")
    cat("Left-to-right answer      :", format(left_to_right, big.mark = ","), "\n")
    cat("Exact fraction            :", format(MASS::fractions(bodmas)), "\n")
    if (bodmas != left_to_right) {
      cat("Verdict: the order changes the answer. Use", bodmas, "for school maths.\n")
    } else {
      cat("Verdict: both orders give the same answer.\n")
    }
    
    # ---- 5. Check every step with the opposite operation --------
    product  <- 37 * 4            # 148
    quotient <- 18 / 3            # 6
    subtotal <- 125 + product     # 273
    final    <- subtotal - quotient
    checks <- c(product / 4 == 37,
                quotient * 3 == 18,
                subtotal - product == 125,
                final + quotient == subtotal)
    cat("Inverse checks passed:", sum(checks), "of", length(checks), "\n")
    cat("Residual (bodmas - final):", bodmas - final, "\n")
    
    # ---- 6. One 300 dpi figure ----------------------------------
    step_names <- c("125 + 37", "x 4", "- 18", "/ 3")
    png("four_function_steps.png", width = 7, height = 4.5, units = "in", res = 300)
    par(mar = c(5, 5, 4, 1))
    bp <- barplot(running, names.arg = step_names, col = "#ea580c", border = NA,
                  ylim = c(0, max(running) * 1.18), las = 1,
                  ylab = "Running total", xlab = "Key pressed (left to right)",
                  main = paste0("Left to right gives ", left_to_right,
                                ", order of operations gives ", bodmas))
    text(bp, running, labels = running, pos = 3, font = 2)
    abline(h = bodmas, col = "#2563eb", lwd = 3, lty = 2)
    legend("topright", legend = c("Basic calculator, left to right",
                                  "Order of operations answer"),
           fill = c("#ea580c", NA), border = NA, lty = c(NA, 2), lwd = c(NA, 3),
           col = c(NA, "#2563eb"), bty = "n")
    invisible(dev.off())
    cat("Saved four_function_steps.png\n")

    Output when run: Order of operations answer: 267. Left-to-right answer: 210. Inverse checks passed: 4 of 4. Residual 0.

    10.2 What each part does

    PartWhat it does
    1. nums, opsThe calculation as numbers and operator symbols. R uses * and /.
    2. eval(parse())Lets R work out the text with its own order of operations: 267.
    3. apply_op loopApplies each key to the running total, like a basic calculator: 162, 648, 630, 210.
    4. MASS::fractionsPrints the answer as an exact fraction, for example 1/7 instead of 0.1428571.
    5. checksUndoes each step: 148 / 4 = 37, 6 * 3 = 18, and so on.
    6. png(..., res = 300)Saves a bar chart of the running total with the correct answer as a dashed line.

    10.3 What the figure shows

    Four orange bars show the running total a basic calculator holds after each key: 162, 648, 630 and 210. The dashed blue line marks 267, the order-of-operations answer. The big jump at "x 4" is the moment the two methods split, because the basic calculator multiplies 162 instead of 37.

    10.4 Common R problems and fixes

    ProblemFix
    0.1 + 0.2 == 0.3 is FALSEUse isTRUE(all.equal(0.1 + 0.2, 0.3))
    round(2.5) gives 2R rounds half to even. For half up use floor(x + 0.5)
    5 / 0 gives Inf, not an errorTest the divisor first, as apply_op does
    Big products print as 1.219326e+17format(x, scientific = FALSE, big.mark = ","), but doubles keep only 15 to 17 digits
    -3^2 is -9Correct on paper too; use (-3)^2 for 9
    Error: could not find function "fractions"Call it as MASS::fractions()

    10.5 Useful one-liners

    TaskR
    Whole-number division and remainder17 %/% 5; 17 %% 5
    Add a percent250 * (1 + 18/100)
    Running total of a listcumsum(c(4.99, 12.50, 3.75, 0.89))
    Square rootsqrt(81)
    Round moneyround(26.1134, 2)
    Exact fractionMASS::fractions(3/8 + 1/4) gives 5/8

    📈 11. How to Do 4 Function Calculations in Python

    Python also follows the order of operations, so 125 + 37 * 4 - 18 / 3 gives 267.0. The script uses fractions.Fraction to keep every answer exact, copies a left-to-right calculator, checks each step and saves a 300 dpi figure.

    fractions built in operator built in matplotlib for the figure

    Install once: pip install matplotlib

    11.1 The complete script

    Python 3, saves four_function_steps.png

    # ============================================================
    # 4 function calculator: order of operations vs left to right
    # StatsUnlock - https://statsunlock.com/4-function-calculator/
    # Needs: pip install matplotlib   (fractions is built in)
    # ============================================================
    from fractions import Fraction
    import operator
    import matplotlib
    matplotlib.use("Agg")            # remove this line in Jupyter to see the plot
    import matplotlib.pyplot as plt
    
    # ---- 1. Your calculation (change these two lines) ----------
    nums = [Fraction(125), Fraction(37), Fraction(4), Fraction(18), Fraction(3)]
    ops = ["+", "*", "-", "/"]
    
    OPS = {"+": operator.add, "-": operator.sub,
           "*": operator.mul, "/": operator.truediv}
    expr_text = str(nums[0]) + "".join(f" {o} {n}" for o, n in zip(ops, nums[1:]))
    print("Calculation:", expr_text)
    
    
    # ---- 2. Order of operations: x and / first, then + and - ----
    def bodmas(nums, ops):
        vals, pending = [nums[0]], []
        for o, n in zip(ops, nums[1:]):
            if o in "*/":
                if o == "/" and n == 0:
                    raise ZeroDivisionError("Division by zero is undefined")
                vals[-1] = OPS[o](vals[-1], n)
            else:
                pending.append(o)
                vals.append(n)
        acc = vals[0]
        for o, v in zip(pending, vals[1:]):
            acc = OPS[o](acc, v)
        return acc
    
    
    # ---- 3. Left to right, like a basic 4 function calculator --
    def left_to_right(nums, ops):
        acc, running = nums[0], []
        for o, n in zip(ops, nums[1:]):
            if o == "/" and n == 0:
                raise ZeroDivisionError("Division by zero is undefined")
            acc = OPS[o](acc, n)
            running.append(acc)
        return acc, running
    
    
    exact = bodmas(nums, ops)
    ltr, running = left_to_right(nums, ops)
    
    # ---- 4. Print the answers -----------------------------------
    print("Order of operations answer:", exact, "=", float(exact))
    print("Left-to-right answer      :", ltr)
    print("Python's own eval         :", eval(expr_text))   # also BODMAS
    if exact != ltr:
        print(f"Verdict: the order changes the answer. Use {exact} for school maths.")
    else:
        print("Verdict: both orders give the same answer.")
    
    # ---- 5. Check every step with the opposite operation --------
    product, quotient = Fraction(37) * 4, Fraction(18) / 3     # 148 and 6
    subtotal = 125 + product                                   # 273
    final = subtotal - quotient
    checks = [product / 4 == 37, quotient * 3 == 18,
              subtotal - product == 125, final + quotient == subtotal]
    print(f"Inverse checks passed: {sum(checks)} of {len(checks)}")
    print("Residual (exact - final):", exact - final)
    print("Floating point trap: 0.1 + 0.2 =", 0.1 + 0.2,
          "| exact:", Fraction("0.1") + Fraction("0.2"))
    
    # ---- 6. One 300 dpi figure ----------------------------------
    names = ["125 + 37", "x 4", "- 18", "/ 3"]
    fig, ax = plt.subplots(figsize=(7, 4.5))
    bars = ax.bar(names, [float(v) for v in running], color="#ea580c")
    ax.bar_label(bars, labels=[str(v) for v in running], fontweight="bold")
    ax.axhline(float(exact), color="#2563eb", lw=3, ls="--",
               label=f"Order of operations answer = {exact}")
    ax.set_ylabel("Running total")
    ax.set_xlabel("Key pressed (left to right)")
    ax.set_title(f"Left to right gives {ltr}, order of operations gives {exact}")
    ax.set_ylim(0, float(max(running)) * 1.18)
    ax.legend(loc="upper right", frameon=False)
    fig.savefig("four_function_steps.png", dpi=300, bbox_inches="tight")
    print("Saved four_function_steps.png")

    Output when run: Order of operations answer: 267. Left-to-right answer: 210. Inverse checks passed: 4 of 4. Floating point trap: 0.1 + 0.2 = 0.30000000000000004, exact 3/10.

    11.2 What each part does

    PartWhat it does
    Fraction(125)Stores numbers as exact fractions, so 1/3 stays 1/3 and 0.1 + 0.2 is exactly 3/10.
    bodmas()Two passes: first every * and /, then every + and −, left to right.
    left_to_right()Applies each key to the running total, like a basic calculator.
    eval(expr_text)Python's own answer, as a float, for comparison.
    checksUndoes every step with the opposite operation.
    fig.savefig(dpi=300)Saves the bar chart with the correct answer as a dashed line.

    Python traps: ^ is not a power in Python, it is bitwise XOR, so 3 ^ 2 is 1 (use 3 ** 2). 7 / 2 is 3.5 but 7 // 2 is 3. round(2.5) is 2, because Python rounds half to even. 0.1 + 0.2 == 0.3 is False.

    11.3 What the figure shows

    The same chart as the R version: the running total of a basic calculator (162, 648, 630, 210) as orange bars and the order-of-operations answer, 267, as a dashed blue line.

    11.4 Common Python problems and fixes

    ProblemFix
    ZeroDivisionErrorCheck the divisor before dividing, or catch it with try / except
    Answer shows 22.130000000000003Use Fraction("4.99") or decimal.Decimal("4.99") for money
    Fraction(0.1) gives a huge fractionPass a string: Fraction("0.1") gives 1/10
    No window appearsDelete the matplotlib.use("Agg") line and add plt.show()
    math.sqrt(-9) raises ValueErrorCorrect: it has no real root. Use cmath.sqrt for 3j

    11.5 Useful one-liners

    TaskPython
    Whole-number division and remainderdivmod(17, 5) gives (3, 2)
    Add a percent250 * (1 + 18 / 100)
    Running totallist(itertools.accumulate([4.99, 12.50, 3.75, 0.89]))
    Exact fractionFraction(3, 8) + Fraction(1, 4) gives 5/8
    Money rounding, half upDecimal("26.1134").quantize(Decimal("0.01"), ROUND_HALF_UP)

    Run it in a terminal with python four_function.py, in Jupyter, or in Google Colab.

    📋 12. Reference Tables

    12.1 Order of operations: the names around the world

    NameStands forUsed in
    PEMDASParentheses, Exponents, Multiplication and Division, Addition and SubtractionUnited States
    BODMASBrackets, Orders (powers), Division and Multiplication, Addition and SubtractionIndia, UK, Pakistan, Nigeria, Australia
    BIDMASBrackets, Indices, Division and Multiplication, Addition and SubtractionEngland (GCSE)
    BEDMASBrackets, Exponents, Division and Multiplication, Addition and SubtractionCanada, New Zealand
    GEMDASGrouping symbols, Exponents, then the same as PEMDASSome US and Philippine schools

    How to use this table: all five names mean the same rule. M and D have equal rank and go left to right, and so do A and S. PEMDAS does not mean "multiply before you divide".

    12.2 Fraction, decimal and percent equivalents

    FractionDecimalPercentType
    1/20.550%Terminating
    1/30.333...33.33%Repeating
    2/30.666...66.67%Repeating
    1/40.2525%Terminating
    3/40.7575%Terminating
    1/50.220%Terminating
    1/60.1666...16.67%Repeating
    1/70.142857...14.29%Repeating, 6-digit cycle
    1/80.12512.5%Terminating
    3/80.37537.5%Terminating
    1/90.111...11.11%Repeating
    1/100.110%Terminating
    1/120.08333...8.33%Repeating

    How to use this table: to turn any fraction into a decimal on a 4 function calculator, divide the top by the bottom. To turn a decimal into a percent, multiply by 100.

    12.3 Perfect squares and their square roots

    n123456789101112131415
    n × n149162536496481100121144169196225

    How to use this table: if the number under √ is in the bottom row, the root is exact (√144 = 12). Any other whole number gives an endless decimal, such as √2 ≈ 1.4142.

    12.4 Calculator keys and what they do

    KeyNameWhat it does
    + − × ÷The four functionsAdd, subtract, multiply, divide
    =EqualsFinishes the calculation and shows the answer
    √Square rootFinds the number that times itself gives the display
    %PercentWorks out a percentage of the number before it
    ± or +/−Change signTurns 5 into −5 and back
    C or ACClear (all clear)Wipes the whole calculation
    CEClear entryWipes only the last number typed
    M+ / M−Memory plus / minusAdds the display to memory, or takes it away
    MR / MCMemory recall / clearShows the memory, or sets it back to 0
    MRCRecall and clearOn many models: press once to recall, twice to clear
    GTGrand totalAdds up every answer since the last clear

    How to use this table: key labels differ between brands. If a key is not listed, check the leaflet that came with the calculator.

    12.5 Sign rules

    OperationRuleExample
    Positive × or ÷ positivePositive6 × 3 = 18
    Negative × or ÷ negativePositive−15 × −2 = 30
    Positive and negative, × or ÷Negative−18 ÷ 3 = −6
    Subtracting a negativeSame as adding9 − (−30) = 39
    Adding a negativeSame as subtracting10 + (−4) = 6

    12.6 What the percent key does

    You typeThis tool givesMeaningEveryday use
    250 × 18%4518% of 250The size of a tip or tax
    250 + 18%295250 plus 18% of 250Price plus tax, bill plus tip
    80 − 15%6880 minus 15% of 80Sale price after a discount
    45 ÷ 18%25045 is 18% of what?Finding the original amount
    18%0.1818 ÷ 100Turning a percent into a decimal

    How to use this table: physical calculators from different brands disagree on some percent key sequences. Test yours with 200 + 10%: if it shows 220, it works like this tool.

    12.7 AP exams that allow a 4-function calculator

    AP examCalculators allowed
    Macroeconomics, Microeconomics, Business with Personal Finance4-function only
    Biology, Environmental Science4-function with square root, or a nongraphing scientific calculator
    ChemistryAllowed, but not recommended
    Physics 1, Physics 2, Physics C4-function, scientific or graphing
    Computer Science A and PrinciplesNone, unless an approved accommodation

    Source: College Board AP calculator policy, checked 17 October 2026. Policies change each year, so check again before exam day.

    12.8 Divisibility rules (check a division before you press =)

    Divides byRuleExample
    2Last digit is even148
    3Digit sum divides by 318: 1 + 8 = 9
    4Last two digits divide by 4148: 48 ÷ 4 = 12
    5Ends in 0 or 5125
    6Divides by 2 and by 318
    8Last three digits divide by 81,000
    9Digit sum divides by 9729: 7 + 2 + 9 = 18
    10Ends in 0250

    📈 13. Example Results

    Eight worked examples, each checked with the calculator above. Copy any calculation into Section 2 to see every step.

    1
    TEXTBOOK CASE

    Order of operations homework

    The example used all through this page.

    Work out 125 + 37 × 4 − 18 ÷ 3.

    answer 26737 × 4 = 14818 ÷ 3 = 6left to right 210
    StepWorkingValue
    137 × 4148
    218 ÷ 36
    3125 + 148273
    4273 − 6267
    Left to right running total compared with the order of operations answerBars of 162, 648, 630 and 210 with a dashed line at 267.7005253501750162125 + 37648× 4630− 18210÷ 3Order of operations: 267
    A left-to-right calculator holds 162, 648, 630 and finishes on 210. The order of operations gives 267.

    What it means: the answer is 267. A basic calculator pressed key by key shows 210 because it adds 125 + 37 before multiplying.

    How to write it: 125 + 37 × 4 − 18 ÷ 3 = 125 + 148 − 6 = 267.

    2
    MONEY

    A shopping bill

    Adding prices exactly, to the cent.

    Bread 4.99, cheese 12.50, fruit 3.75 and a bag 0.89.

    total 22.134 itemsexact to the cent
    ItemPriceRunning total
    Bread4.994.99
    Cheese12.5017.49
    Fruit3.7521.24
    Bag0.8922.13
    Running total of a shopping billBars rising to 4.99, 17.49, 21.24 and 22.13.2518.7512.56.2504.99Bread17.49+ Cheese21.24+ Fruit22.13+ Bag
    The running total climbs to 22.13. An ordinary program prints 22.130000000000003; this tool prints 22.13.

    What it means: the bill is 22.13. Exact decimal arithmetic matters for money, where a stray 0.000000000000003 can break a comparison in a spreadsheet.

    How to write it: Total = 4.99 + 12.50 + 3.75 + 0.89 = 22.13.

    3
    PERCENT

    A restaurant bill plus tip, split four ways

    The percent key and one division.

    A bill of 250 with an 18% tip, shared by 4 friends.

    tip 45total 295each 73.75
    StepKeysValue
    Tip250 × 18%45
    Total250 + 18%295
    Each person295 ÷ 473.75
    Restaurant bill plus 18 percent tip split four waysA bar of 250 plus 45 makes 295, then four bars of 73.75.Bill 250Tip 45 → 29573.75Friend 173.75Friend 273.75Friend 373.75Friend 4
    The bill (blue) plus the 18% tip (orange) makes 295, which splits into four shares of 73.75.

    What it means: each friend pays 73.75. Typing 250 + 18% gives the total in one go.

    How to write it: (250 + 18% of 250) ÷ 4 = 295 ÷ 4 = 73.75 each.

    4
    FRACTIONS

    Adding cups of flour

    Fractions on a calculator with no fraction key.

    A recipe needs 3/8 cup and then 1/4 cup of flour. How much in total?

    5/8 cup0.625left to right 0.34375
    StepKeysValue
    3/83 ÷ 80.375
    1/41 ÷ 40.25
    Total0.375 + 0.250.625 = 5/8
    Fraction bar showing 3/8 plus 2/8 equals 5/8One cup split into 8 parts: 3 blue, 2 green, 3 empty.3/8 cup1/4 = 2/8 cup5 of 8 parts filled: 5/8 = 0.625 cup
    3/8 plus 2/8 fills 5 of the 8 parts of one cup.

    What it means: the total is 5/8 cup. Typed in one line on a left-to-right calculator, 3 ÷ 8 + 1 ÷ 4 gives 0.34375, which is wrong. Use the memory key or brackets.

    How to write it: 3/8 + 1/4 = 3/8 + 2/8 = 5/8 = 0.625 cup.

    5
    LARGE NUMBERS

    When the screen runs out of digits

    An 8-digit display shows E. This tool does not.

    Work out 987654321 × 123456789.

    18 digits1.219326311 × 10178-digit screen: E
    WhereShows
    This tool121,932,631,112,635,269
    Excel121,932,631,112,635,000 (15 digits kept)
    8-digit basic calculatorE (overflow)
    Eighteen digit answer compared with an eight digit screenEighteen digit boxes; only the first eight fit inside the calculator screen outline.8-digit screen12193263111263526910 digits do not fit, so a basic calculator shows E (overflow)Exact: 121,932,631,112,635,269 ≈ 1.22 × 10^17
    Only 8 of the 18 digits fit on a basic calculator screen, so it shows an overflow error.

    What it means: the exact product has 18 digits. A basic calculator cannot hold it, and Excel quietly changes the last three digits to 000.

    How to write it: 987654321 × 123456789 = 121,932,631,112,635,269 ≈ 1.22 × 1017.

    6
    UNDEFINED

    Dividing by zero

    Why the screen says E.

    Work out 45 ÷ 0.

    undefinedscreen: E
    Divisor45 ÷ divisor
    145
    0.1450
    0.014,500
    0.00145,000
    0no answer
    Dividing 45 by smaller and smaller numbersBars on a log scale for 45, 450, 4500 and 45000, then a dashed fuchsia line at a divisor of 0.45÷ 1450÷ 0.14,500÷ 0.0145,000÷ 0.001÷ 0no answerEach step is 10 times bigger (log scale)
    As the divisor shrinks towards 0 the answer grows without limit, so no number can be the answer at 0.

    What it means: 45 ÷ 0 is undefined. If it equalled some number q, then q × 0 would be 45, but anything times 0 is 0.

    How to write it: 45 ÷ 0 is undefined (no real answer).

    7
    REPEATING DECIMAL

    Why 1 ÷ 3 × 3 can show 0.9999999

    The screen cuts off a decimal that never ends.

    Work out 1 ÷ 7, then 1 ÷ 3 × 3.

    1/7 = 0.142857 repeating6-digit cyclebasic screen: 0.9999999
    CalculationThis tool8-digit basic calculator
    1 ÷ 71/7 = 0.1428570.1428571
    1 ÷ 3 × 310.9999999
    The repeating cycle of one seventhThe digits 1, 4, 2, 8, 5, 7 placed around a circle with arrows, repeating forever.1428571 ÷ 7 =0.142857142857...
    The six digits 1, 4, 2, 8, 5, 7 repeat forever. A screen can only show the first few.

    What it means: 1/7 never ends, so any decimal on a screen is rounded or cut. Keeping fractions exact, as this tool does, gives 1 ÷ 3 × 3 = 1 exactly.

    How to write it: 1 ÷ 7 = 1/7 ≈ 0.1429 (4 d.p.).

    8
    TRAP

    The viral one: 6 ÷ 2 × (1 + 2)

    Answer 9, not 1.

    Work out 6 ÷ 2 × (1 + 2).

    answer 9common wrong answer 1
    StepWorkingValue
    Bracket1 + 23
    Left to right6 ÷ 23
    Then3 × 39
    Correct and incorrect ways to work out 6 divided by 2 times 3Top path: 6 ÷ 2 = 3, then 3 × 3 = 9 in green. Bottom path: 2 × 3 = 6 first, then 6 ÷ 6 = 1 in fuchsia.6 ÷ 2 × (1 + 2) = 6 ÷ 2 × 36 ÷ 2 = 33 × 3 = 9Correct: 92 × 3 = 66 ÷ 6 = 1Wrong order: 1× and ÷ have equal rank: work left to right
    Division and multiplication have equal rank, so they go left to right: 6 ÷ 2 first, then × 3.

    What it means: the answer is 9. People who get 1 multiply 2 × 3 before dividing, which breaks the left-to-right rule for × and ÷.

    How to write it: 6 ÷ 2 × (1 + 2) = 6 ÷ 2 × 3 = 3 × 3 = 9.

    ✏️ 14. How to Do 4 Function Calculations by Hand, Step by Step

    This is the pen and paper method a teacher expects to see, worked on the same example as Sections 7, 9, 10 and 11: 125 + 37 × 4 − 18 ÷ 3.

    14.1 The written method

    1. Copy the calculation and look for brackets. There are none, so start with × and ÷.
    2. Underline every × and ÷. Here: 37 × 4 and 18 ÷ 3.
    3. Multiply 37 × 4 in a column. 7 × 4 = 28: write 8, carry 2. 3 × 4 = 12, plus the carried 2 is 14. Write 14. The answer is 148.
    4. Divide 18 ÷ 3. 3 × 6 = 18, so 18 ÷ 3 = 6.
    5. Rewrite the line with the new numbers. 125 + 148 − 6.
    6. Add 125 + 148 in a column. 5 + 8 = 13: write 3, carry 1. 2 + 4 + 1 = 7. 1 + 1 = 2. The answer is 273.
    7. Subtract 273 − 6. 3 − 6 does not work, so borrow: 13 − 6 = 7, and the 7 tens become 6 tens. The answer is 267.
    8. Estimate to check. 120 + 40 × 4 − 6 = 274, close to 267, so the size is right.
    9. Check with opposite operations. 267 + 6 = 273, 273 − 148 = 125, 148 ÷ 4 = 37, 6 × 3 = 18. All check.

    14.2 On a real calculator

    CalculatorKeysWhat you see
    Basic 4 function (most pocket and desk models)125 + 37 × 4 − 18 ÷ 3 =210 (wrong for school maths: left to right)
    Basic 4 function, memory methodMC 37 × 4 = M+ 18 ÷ 3 = M− 125 M+ MR267
    Basic 4 function, reordered37 × 4 + 125 =, write down 273, then 18 ÷ 3 =, then 273 − 6 =267
    Casio fx-991EX (ClassWiz) or fx-82MS125 + 37 × 4 − 18 ÷ 3 =267 (follows the order of operations)
    TI-84 Plus CE125 + 37 × 4 − 18 ÷ 3 ENTER267

    Most basic 4 function calculators use immediate execution, but some newer models follow the order of operations. Test yours with 2 + 3 × 4: if it shows 20 it works left to right, if it shows 14 it follows BODMAS. Memory key labels differ (some use MRC: press once to recall, twice to clear), so check the leaflet for your model.

    14.3 Practice problems with answers

    1. 48 + 27

    75

    2. 365 − 189

    176

    3. 24 × 15

    360

    4. 1000 ÷ 8

    125

    5. 12 + 6 × 3 (trap)

    30. Left to right gives 54, which is wrong for school maths.

    6. 100 − 36 ÷ 4 × 2

    82. 36 ÷ 4 = 9, 9 × 2 = 18, 100 − 18 = 82.

    7. 7.5 × 0.4

    3

    8. 80 − 15% (sale price)

    68. 15% of 80 is 12.

    9. 2 ÷ 3 + 1 ÷ 6

    5/6 ≈ 0.8333

    10. 9 ÷ (5 − 5)

    Undefined. The bracket is 0, and you cannot divide by 0.

    14.4 Mistakes that lose marks

    • Typing a long calculation into a basic calculator and trusting the left-to-right answer.
    • Doing × before ÷ because M comes before D in PEMDAS. They have equal rank: go left to right.
    • Rounding in the middle of the working. Keep full figures and round only the final answer.
    • Losing a minus sign: −15 × −2 is +30, not −30.
    • Reading 0.9999999 as a different answer from 1. It is the screen cutting off 1/3 × 3.
    • Skipping the estimate. A misplaced decimal point (26.7 or 2,670) is easy to spot with a rough check.

    🎯 15. When Should You Use a 4 Function Calculator?

    Use a 4 function calculator when the job needs only +, −, ×, ÷, √ or %, such as a shopping bill, a tip, a budget or an exam that bans scientific calculators. Switch to a scientific calculator for powers, logs or trig, to a graphing calculator for graphs, and to a spreadsheet for long columns of numbers.

    Use a 4 function calculator when

    • The job is only +, −, ×, ÷, √ or %.
    • You are adding a bill, a budget or a till.
    • Your exam allows only a basic calculator.
    • You want big keys and no menus.
    • You are checking homework one operation at a time.

    Use something else when

    • You need powers, logs, sin or cos: use a scientific calculator.
    • You need to see a graph: use a graphing calculator.
    • You have a column of 50 numbers: use a spreadsheet.
    • You need exact fractions: use a fraction or mixed number calculator.
    • You need a mean or median: use a statistics calculator.

    15.1 Four real examples

    TaskBest toolWhy
    Add a grocery receipt4 function calculatorOnly addition, and the GT or M+ key keeps the total
    Chi-square value in AP Biology4 function with √Only −, ×, ÷ and squaring by multiplying are needed
    Compound interest over 10 yearsScientific calculatorNeeds a power key, (1.05)10
    Class marks for 30 studentsSpreadsheetSUM and AVERAGE across a whole column

    15.2 Decision tree

    1. Does the problem need a power, log, sin, cos or tan? Yes → scientific calculator. No → go on.
    2. Do you need to see a graph? Yes → graphing calculator. No → go on.
    3. Are there more than about 20 numbers? Yes → spreadsheet or Batch mode above. No → go on.
    4. Does the calculation mix + or − with × or ÷? Yes → use this tool in Order of operations mode, or the memory method on a basic calculator. No → any 4 function calculator is fine.

    🔧 16. Why Is My Calculator Answer Wrong? Common Mistakes and Fixes

    Most wrong calculator answers come from the order of the keys, not from the calculator. A basic model works left to right, so 2 + 3 × 4 shows 20 instead of 14. The other usual causes are a lost minus sign, rounding too early, an old value left in memory, and a percent key that works differently from the one you expect.

    My calculator and my textbook give different answers

    Cause: your calculator works left to right; the textbook uses the order of operations. Fix: do the × and ÷ parts first, or use the memory method in Section 14.2.

    The screen shows E or Error

    Cause: division by 0, the square root of a negative number, or an answer with too many digits for the screen. Fix: check the divisor and the sign, or use this tool, which shows every digit.

    I got 0.9999999 instead of 1

    Cause: a repeating decimal such as 1/3 was cut off by the screen. Fix: round the final answer, or do the multiplication before the division (1 × 3 ÷ 3).

    The % key gives a strange number

    Cause: brands handle the % key differently. Fix: work percents out the long way: 18% of 250 is 250 × 18 ÷ 100 = 45.

    My answer is off by a minus sign

    Cause: the − key was used instead of ±, or a negative times a negative was given a minus. Fix: use the sign rules in Table 12.5 and put negative numbers in brackets.

    The tool says "Two operators in a row"

    Cause: something like 5 + × 3 was typed. Fix: delete one of the operators. A minus sign straight after × or ÷ is fine: 15 × −2.

    The tool says "A 4 function calculator has no power key"

    Cause: the ^ sign was typed. Fix: write 32 as 3 × 3, or use a scientific calculator for larger powers.

    Memory gives the wrong total

    Cause: an old value was still in memory. Fix: press MC (or MRC twice) before you start, and look for the small M on the screen.

    Excel shows #DIV/0! or ########

    Cause: dividing by an empty or zero cell, or a column that is too narrow. Fix: see Table 9.6.

    Money totals end in 0.000000000003

    Cause: binary floating point in spreadsheets and code. Fix: round to 2 decimal places, or use exact tools such as this calculator, Python's Fraction or Decimal.

    ⚖ 17. Assumptions and Limitations

    Assumptions

    1. Real numbers only. The square root of a negative number is reported as not real. To check: the number under √ must be 0 or more. If you need complex numbers (3i), use a scientific calculator with a complex mode.
    2. Typed decimals are exact. 0.333 is read as 333/1000, not 1/3. To check: type 1 ÷ 3 when you mean one third.
    3. The order of operations is BODMAS / PEMDAS by default. Switch to Left to right to copy a basic calculator. Implied multiplication, as in 2(3), is treated as an ordinary × with the same rank as ÷.
    4. The percent key follows the common rule. a + b% adds b% of a. If your teacher or your calculator uses a different rule, work the percent out separately.
    5. Rounding is half away from zero, the same as Excel ROUND. R and Python round a final 5 to the nearest even digit instead.

    Limitations

    1. No powers, logs or trig. That is by design for a 4 function calculator. Use a scientific calculator.
    2. Square roots of non-square numbers are rounded to 40 decimal places, so they show a Rounded badge instead of an exact form.
    3. Very long calculations slow down. Numbers with thousands of digits work, but keep a single line under about 2,000 characters.
    4. Batch mode reads up to 500 lines and only the first column of a CSV file.
    5. Percent key behaviour varies by brand. This tool cannot copy every model; Table 12.6 lists its rules.

    🏁 18. Conclusion

    A 4 function calculator does four things, addition, subtraction, multiplication and division, and that covers most everyday maths. The one rule that trips people up is the order: many basic calculators work left to right, while school maths does × and ÷ before + and −. This tool gives you both answers, keeps every number exact, and checks each step.

    What the answer is

    ___ Solve a problem above.

    What it tells you

    ___ Solve a problem above.

    Watch out for

    ___ Solve a problem above.

    Next steps

    ___ Solve a problem above.

    For money, round to 2 decimal places at the very end. For fractions, keep the fraction until the last step. For long calculations on a real basic calculator, use the memory keys. And whatever you use, estimate first, so a wrong answer looks wrong straight away. That habit is the best partner for any 4 function calculator.

    ❓ 19. Frequently Asked Questions

    What is a 4 function calculator?

    A 4 function calculator is a basic calculator that adds, subtracts, multiplies and divides. Most models also have square root, percent, sign change and memory keys, but no powers, logs, trig or graphs. It is the calculator most people mean when they say "a basic calculator", and it is the type many schools and exams ask for.

    What are the 4 functions of a calculator?

    The four functions are addition (+), subtraction (−), multiplication (×) and division (÷). Every other operation on a basic calculator, such as percent, is built from these four. Subtraction undoes addition and division undoes multiplication, which is how this page checks every answer.

    What is a basic 4 function calculator?

    A basic 4 function calculator is the simplest pocket or desk calculator, with a one-line screen of 8 to 12 digits and the four arithmetic keys. It is the type allowed in exams that ban scientific and graphing calculators. Typical models cost 2 to 10 US dollars and run on a solar cell or a button battery.

    Is a scientific calculator a 4 function calculator?

    No. A scientific calculator can do the four functions, but it also has powers, roots, logs and trig keys. An exam that asks for a 4 function calculator will not accept a scientific one. The reverse is not true either: a basic calculator cannot work out 210 or sin 30 without many extra key presses.

    Does a 4 function calculator have a square root?

    Most do. The √ key is common on basic models, and College Board specifically allows a 4-function calculator with square root on AP Biology and AP Environmental Science. Powers, cube roots and logs are not included, so for those you need a scientific calculator.

    Does a 4 function calculator follow the order of operations?

    Usually not. Most basic models do each operation as soon as you press the next key, so they work left to right. This tool lets you choose either rule and shows both answers. Test yours with 2 + 3 × 4: it shows 20 if it works left to right and 14 if it follows BODMAS.

    Why does my calculator say 2 + 3 × 4 = 20?

    Because it works left to right: it adds 2 + 3 = 5 first, then multiplies by 4. With the order of operations the answer is 14, because 3 × 4 = 12 is done first. Nothing is broken. Press 3 × 4 first, then add 2, or use the M+ key, to get the textbook answer of 14.

    Can you use a 4 function calculator on the AP Biology exam?

    Yes. College Board allows a 4-function calculator with square root, or a nongraphing scientific calculator, on AP Biology and AP Environmental Science. Check the current policy before exam day. A 4-function calculator without a square root key is also allowed, but the root key helps with standard deviation and chi-square work.

    What does the % key do on a 4 function calculator?

    The % key works out a percentage of the number before it. On this tool 250 × 18% = 45, 250 + 18% = 295 and 80 − 15% = 68. Some brands handle the key differently, so test yours with 200 + 10%.

    How do you use the memory keys on a calculator?

    M+ adds the number on the screen to memory, M− subtracts it, MR shows what is stored, and MC clears it. Clear the memory before you start so an old value does not spoil the total. For example, 37 × 4 M+, 18 ÷ 3 M−, 125 M+, then MR shows 267.

    What does E mean on a calculator?

    E means error. It appears when you divide by zero, take the square root of a negative number, or get an answer with more digits than the screen can show. Press C or AC to clear it, then check the step that caused it before you try again.

    Why can't you divide by zero?

    Because no number works. If 45 ÷ 0 equalled some number q, then q × 0 would have to be 45, but any number times 0 is 0. So the answer is undefined. Dividing a number by smaller and smaller numbers gives bigger and bigger answers, with no limit at 0.

    How do you do fractions on a 4 function calculator?

    Divide the top number by the bottom number. 3/8 is 3 ÷ 8 = 0.375. To add fractions, turn each into a decimal, store them with M+, then press MR, or type the whole line into this tool, which keeps the exact fraction.

    How do you do exponents on a 4 function calculator?

    Multiply the number by itself: 34 is 3 × 3 × 3 × 3 = 81. On many basic models, pressing 3 × = squares the number and each further = multiplies by 3 again. Check your model with 3 × = = before you rely on it in a test.

    What is the difference between C and CE on a calculator?

    C (or AC) clears the whole calculation. CE clears only the last number you typed, so you can fix a typing slip without starting again. For example, if you typed 125 + 73 by mistake, press CE and type 37 to carry on without losing the 125. Some models use one key that clears the entry on the first press and everything on the second.

    How do I do 4 function calculations in Excel?

    Start the cell with = and use + − * and /, for example =125+37*4-18/3, which gives 267. Excel follows the order of operations. Section 9 shows SUM, PRODUCT, QUOTIENT, MOD and percents.

    How do I do the four operations in R?

    Type them directly: 125 + 37 * 4 - 18 / 3 prints 267. Use %/% for whole-number division and %% for the remainder. Section 10 has a full script with a chart. R also follows the order of operations, and MASS::fractions() shows an answer such as 0.625 as 5/8.

    How do I do the four operations in Python?

    Use + - * and /, so 125 + 37 * 4 - 18 / 3 gives 267.0. Use // for whole-number division, % for the remainder, and fractions.Fraction for exact answers. Never use ^ for powers. Python also follows the order of operations, so it agrees with this tool's default mode.

    How do I use a Casio scientific calculator as a 4 function calculator?

    Type the calculation as written and press =. Models such as the Casio fx-991EX and fx-82MS follow the order of operations, so 125 + 37 × 4 − 18 ÷ 3 = shows 267. A basic Casio pocket calculator, by contrast, usually works left to right and shows 210 for the same keys.

    Is this 4 function calculator free and accurate?

    Yes. It is free, needs no sign-up, and uses exact fraction arithmetic, so 0.1 + 0.2 gives exactly 0.3 and large products keep every digit. Every step is checked with the opposite operation. It also shows what a left-to-right calculator would give, so you can see why two answers differ.

    📑 20. Cite This Tool

    APA 7th edition
    StatsUnlock Team. (2026). 4 function calculator [Interactive calculator]. StatsUnlock. https://statsunlock.com/4-function-calculator/
    BibTeX
    @misc{statsunlock_4function_2026, title={4 Function Calculator}, author={{StatsUnlock Team}}, year={2026}, note={Interactive calculator}, url={https://statsunlock.com/4-function-calculator/}}
    Working sentence (fills in after Calculate)
    Arithmetic was checked with the StatsUnlock 4 function calculator (2026), which uses exact fraction arithmetic and the order of operations.

    🔗 21. Related Tools

    📖 22. Glossary of Terms

    TermPlain-English meaning
    BODMAS / PEMDASMemory aids for the order of operations: brackets, then powers, then × and ÷, then + and −.
    Chain calculationA calculation done one key after another, each step using the last answer.
    DifferenceThe answer to a subtraction.
    DividendThe number being divided. In 18 ÷ 3, it is 18.
    DivisorThe number you divide by. In 18 ÷ 3, it is 3. It must not be 0.
    EstimationA quick rounded calculation in your head, used to check that an answer is the right size.
    Exact answerThe true value, kept as a whole number or fraction with no rounding.
    Floating pointThe way computers store decimals in binary, which makes 0.1 + 0.2 slightly different from 0.3.
    Immediate executionHow a basic calculator works: each operation is done as soon as the next key is pressed.
    Inverse operationThe operation that undoes another: − undoes +, ÷ undoes ×.
    Memory (M)A store inside the calculator for one number, used with M+, M−, MR and MC.
    OperandA number that an operation works on. In 37 × 4, the operands are 37 and 4.
    Order of operationsThe agreed rule for which part of a calculation to do first.
    OverflowAn answer too long for the screen, shown as E on a basic calculator.
    PercentOut of 100. 18% means 18 ÷ 100 = 0.18.
    ProductThe answer to a multiplication.
    QuotientThe answer to a division.
    Repeating decimalA decimal with a block of digits that repeats forever, such as 1/7 = 0.142857142857...
    Square rootThe number that times itself gives the original number. √81 = 9.
    SumThe answer to an addition.
    Terminating decimalA decimal that stops, such as 3/8 = 0.375.
    UndefinedHaving no answer at all, as with any number divided by 0.

    📚 23. References

    Peer-reviewed research behind this 4 function calculator: calculator use in schools, the order of operations, division by zero, percent, exact versus floating-point arithmetic, and the history of the square root.

    1. Bofferding, L. (2014). Negative integer understanding: Characterizing first graders' mental models. Journal for Research in Mathematics Education, 45(2), 194–245. https://doi.org/10.5951/jresematheduc.45.2.0194
    2. Close, S., Oldham, E., Shiel, G., Dooley, T., & O'Leary, M. (2012). Effects of calculators on mathematics achievement and attitudes of ninth-grade students. The Journal of Educational Research, 105(6), 377–390. https://doi.org/10.1080/00220671.2011.629857
    3. Crespo, S., & Nicol, C. (2006). Challenging preservice teachers' mathematical understanding: The case of division by zero. School Science and Mathematics, 106(2), 84–97. https://doi.org/10.1111/j.1949-8594.2006.tb18138.x
    4. Dimmel, J. K., & Pandiscio, E. A. (2020). When it's on zero, the lines become parallel: Preservice elementary teachers' diagrammatic encounters with division by zero. The Journal of Mathematical Behavior, 58, 100760. https://doi.org/10.1016/j.jmathb.2020.100760
    5. Ellington, A. J. (2003). A meta-analysis of the effects of calculators on students' achievement and attitude levels in precollege mathematics classes. Journal for Research in Mathematics Education, 34(5), 433–463. https://doi.org/10.2307/30034795
    6. Ellington, A. J. (2006). The effects of non-CAS graphing calculators on student achievement and attitude levels in mathematics: A meta-analysis. School Science and Mathematics, 106(1), 16–26. https://doi.org/10.1111/j.1949-8594.2006.tb18067.x
    7. Fowler, D., & Robson, E. (1998). Square root approximations in Old Babylonian mathematics: YBC 7289 in context. Historia Mathematica, 25(4), 366–378. https://doi.org/10.1006/hmat.1998.2209
    8. Glidden, P. L. (2008). Prospective elementary teachers' understanding of order of operations. School Science and Mathematics, 108(4), 130–136. https://doi.org/10.1111/j.1949-8594.2008.tb17830.x
    9. Goldberg, D. (1991). What every computer scientist should know about floating-point arithmetic. ACM Computing Surveys, 23(1), 5–48. https://doi.org/10.1145/103162.103163
    10. Gunnarsson, R., Sönnerhed, W. W., & Hernell, B. (2016). Does it help to use mathematically superfluous brackets when teaching the rules for the order of operations? Educational Studies in Mathematics, 92(1), 91–105. https://doi.org/10.1007/s10649-015-9667-2
    11. Hembree, R., & Dessart, D. J. (1986). Effects of hand-held calculators in precollege mathematics education: A meta-analysis. Journal for Research in Mathematics Education, 17(2), 83–99. https://doi.org/10.2307/749255
    12. Higham, N. J. (1993). The accuracy of floating point summation. SIAM Journal on Scientific Computing, 14(4), 783–799. https://doi.org/10.1137/0914050
    13. Kahan, W. (1965). Pracniques: Further remarks on reducing truncation errors. Communications of the ACM, 8(1), 40. https://doi.org/10.1145/363707.363723
    14. Kieran, C. (1981). Concepts associated with the equality symbol. Educational Studies in Mathematics, 12(3), 317–326. https://doi.org/10.1007/BF00311062
    15. Parker, M., & Leinhardt, G. (1995). Percent: A privileged proportion. Review of Educational Research, 65(4), 421–481. https://doi.org/10.3102/00346543065004421
    16. Quinn, R. J., Lamberg, T. D., & Perrin, J. R. (2008). Teacher perceptions of division by zero. The Clearing House, 81(3), 101–104. https://doi.org/10.3200/TCHS.81.3.101-104
    17. Reys, R. E., Rybolt, J. F., Bestgen, B. J., & Wyatt, J. W. (1982). Processes used by good computational estimators. Journal for Research in Mathematics Education, 13(3), 183–201. https://doi.org/10.2307/748555
    18. Rittle-Johnson, B., Siegler, R. S., & Alibali, M. W. (2001). Developing conceptual understanding and procedural skill in mathematics: An iterative process. Journal of Educational Psychology, 93(2), 346–362. https://doi.org/10.1037/0022-0663.93.2.346
    19. Siegler, R. S., & Booth, J. L. (2004). Development of numerical estimation in young children. Child Development, 75(2), 428–444. https://doi.org/10.1111/j.1467-8624.2004.00684.x
    20. Young, J. (2017). Technology-enhanced mathematics instruction: A second-order meta-analysis of 30 years of research. Educational Research Review, 22, 19–33. https://doi.org/10.1016/j.edurev.2017.07.001
    STATS UNLOCK · statsunlock.com · 4 Function Calculator · By the StatsUnlock Team · Last updated 17 October 2026
    RELATED ARTICLES

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here

    Most Popular

    Statistical Models

    Important Plots & Charts

    Calculators and Converters