1. From pocket calculator to scientific calculator
In 1972, Hewlett-Packard released the HP-35, the first handheld calculator capable of evaluating trigonometric and logarithmic functions. Its launch price of $395 (roughly $2,500 in today's money) made it a professional instrument rather than a consumer product, but it transformed the work of engineers and scientists who had until then carried slide rules in their shirt pockets. Before the HP-35, computing sin(37°) by hand meant consulting a printed logarithm table across multiple pages, then performing linear interpolation to reach the desired precision — a process that took several minutes and carried real risk of reading errors.
The following decade brought scientific calculators to the masses. Casio democratised the category with the FX-1 in 1972, followed by the iconic FX series (FX-82, FX-570), tens of millions of which were sold in secondary schools worldwide. Texas Instruments responded with the TI-30, launched in 1976 at $24.95 — a radical price drop. The TI-30 remains one of the world's best-selling calculators in its class to this day.
Before diving into advanced functions, it helps to distinguish the four main categories of calculators:
- Basic (arithmetic) calculator: the four operations, sometimes a percentage and a square root. Sufficient for shopping, everyday bookkeeping, tipping.
- Scientific calculator: adds trigonometry, logarithms, exponentials, factorials, angle conversions. The subject of this guide.
- Graphing calculator: displays function curves on a matrix screen. The TI-84 and Casio fx-9750G are the standard references in high school and college. Indispensable for visualising function behaviour, finding zeros, or locating extrema graphically.
- CAS (Computer Algebra System): Mathematica, Maple, SageMath, or the TI-Nspire CAS. These systems manipulate symbolic expressions: they factorise, differentiate, integrate exactly, and solve literal equations. A wholly different category, closer to professional mathematics software than to a calculator.
The SAW TOOLS scientific calculator belongs to the second category: it covers all the functions described in this guide, with the IEEE 754 double-precision accuracy of the JavaScript engine, right in your browser.
2. Normal mode and scientific mode
A scientific calculator typically offers two result-display modes: normal mode and scientific notation mode. These modes do not alter the underlying calculation — they change how the result is presented.
Normal mode
In normal mode, the calculator displays results as standard decimals. 1 / 8 = 0.125, 3 × 7 = 21. This is the mode for everyday tasks: areas, prices, simple conversions. Our unit converter, for instance, only needs arithmetic in normal mode.
Normal mode hits its limits with very large or very small numbers. Displaying 602,214,076,000,000,000,000,000 (Avogadro's number) as a plain decimal is not only difficult to read — most display panels cannot accommodate that many digits. That is where scientific notation comes in.
Scientific mode
In scientific mode, every number is expressed as a × 10^n, where 1 ≤ |a| < 10 and n is an integer. Avogadro's number becomes 6.022 × 10²³. The elementary charge of an electron, 0.000000000000000000160219 C, becomes 1.602 × 10⁻¹⁹.
This mode is indispensable in physics, chemistry, astronomy, and any discipline spanning multiple orders of magnitude. It also makes the precision of a measurement immediately visible: 3.00 × 10⁸ indicates three significant figures, whereas 3 × 10⁸ indicates only one.
In practice, scientific mode is paired with EE notation (Enter Exponent): on a keyboard you type 6.022e23, where e means "times 10 to the power of". This notation is universal across programming languages and spreadsheets.
3. Trigonometry: sin, cos, tan and their inverses
Trigonometry literally means the measurement of triangles (from the Greek trigonon, triangle, and metron, measure). Its roots extend to the Greek astronomer Hipparchus of Nicaea (190–120 BC), often regarded as the father of trigonometry, and to Indian mathematicians of the 5th century who developed the first tables of sines.
Geometric definitions
In a right triangle with hypotenuse h, adjacent side a, and opposite side o to angle θ:
- sin(θ) = o / h — ratio of the opposite side to the hypotenuse
- cos(θ) = a / h — ratio of the adjacent side to the hypotenuse
- tan(θ) = o / a = sin(θ) / cos(θ) — ratio of the opposite to the adjacent side
On the unit circle (radius = 1, centred at the origin), a point M at angle θ has coordinates (cos θ, sin θ). This definition extends sin and cos to all real angles, including negative ones or those greater than 360°. Periodicity is immediately visible: sin and cos have period 2π, tan has period π.
Degrees, radians, gradians
Three units coexist for measuring angles:
- Degree (°): 360° for a full turn. A Babylonian legacy — their base-60 numeral system explains why a circle has 360 = 6 × 60 degrees. Intuitive for everyday use.
- Radian (rad): the SI unit. One radian is the angle for which the arc length equals the radius. A full turn is 2π ≈ 6.2832 rad. All infinitesimal calculus formulas (derivatives, integrals, Taylor series) assume angles are in radians — which is why every programming language uses radians internally.
- Gradian (gon): 400 gradians per full turn (100 gon per right angle). Invented during the French Revolution as part of the effort to decimalise all measurements. Still used in geodesy and land surveying across continental Europe.
The conversion is straightforward: angle_rad = angle_deg × π / 180. In JavaScript:
// Compute sin(45°) in JavaScript
const angleDeg = 45;
const angleRad = angleDeg * Math.PI / 180;
Math.sin(angleRad); // → 0.7071067811865476 (i.e. √2 / 2)
Wrong angle mode is the single most common trigonometry mistake. If your calculator is in radians and you type sin(90), you do not get 1 but sin(90 rad) ≈ 0.894. The correct value sin(90°) = 1 only appears when in DEG mode, or when computing sin(π/2). This pitfall is particularly insidious in engineering: structural calculation errors have been attributed to angle-mode confusion.
Inverse functions: arcsin, arccos, arctan
The inverse (or arc) functions answer the question: for what angle θ is sin(θ) = x? They are written arcsin (or sin⁻¹), arccos (or cos⁻¹), arctan (or tan⁻¹).
Pay attention to domains:
- arcsin: input in [−1, 1], output in [−π/2, π/2] (−90° to 90°)
- arccos: input in [−1, 1], output in [0, π] (0° to 180°)
- arctan: input in ℝ, output in (−π/2, π/2). The two-argument variant atan2(y, x) returns the angle in [−π, π] accounting for the correct quadrant — essential in computer graphics and robotics.
Attempting to evaluate arcsin(2) returns an error or NaN (Not a Number) because 2 lies outside the domain. This is a mathematically correct result, not a malfunction.
4. Hyperbolic trigonometry
The hyperbolic functions — sinh, cosh, tanh — take their name from the hyperbola rather than the circle. Where sin and cos parameterise a circle (x = cos t, y = sin t), sinh and cosh parameterise an equilateral hyperbola (x = cosh t, y = sinh t). Their definitions via the exponential function are elegant and fundamental:
- sinh(x) = (e^x − e^(−x)) / 2
- cosh(x) = (e^x + e^(−x)) / 2
- tanh(x) = sinh(x) / cosh(x) = (e^x − e^(−x)) / (e^x + e^(−x))
These definitions immediately reveal useful properties: cosh(x) ≥ 1 for all real x, and tanh(x) is strictly bounded between −1 and 1.
Real-world applications
The catenary: the curve formed by a cable hanging between two points under gravity is not a parabola — it is a catenary with equation y = a · cosh(x/a). Galileo believed it was a parabola; the correct answer was found independently by Leibniz, Huygens, and Johann Bernoulli in 1691. Engineers designing suspension bridges, overhead power lines, or ski-lift cables use cosh routinely.
Special relativity: the Lorentz transformations describing the relativity of time and space for observers in relative motion are naturally expressed with hyperbolic functions. Rapidity ϕ (the boost parameter) relates to velocity by v = c · tanh(ϕ).
Artificial neural networks: tanh is one of the most widely used activation functions in deep learning. Its advantage over the classic sigmoid: its output is zero-centred (ranging from −1 to 1 rather than 0 to 1), which speeds up convergence during backpropagation.
5. Logarithms: ln, log, log₂
The logarithm is the inverse of the exponential. If b^y = x, then log_b(x) = y. In other words: log_b(x) answers the question "to what power must b be raised to obtain x?"
Three bases dominate practice:
ln — the natural logarithm (base e)
ln(x) is the logarithm in base e ≈ 2.71828. It is "natural" in the sense that it is the antiderivative of 1/x, and the derivative of e^x is e^x itself. Any quantity whose rate of change is proportional to its current value is modelled via ln and e^x: bacterial growth, radioactive decay (half-life: t = ln(2) / λ), continuously compounded interest.
log — the common logarithm (base 10)
log(x) = log₁₀(x) measures orders of magnitude. Its practical applications are numerous:
- Decibels: dB = 10 × log(P₂/P₁). Doubling acoustic power = +3 dB. A factor of 10 = +10 dB. A factor of 100 = +20 dB. The decibel scale compresses a colossal amplitude range (factor of 10¹² from the threshold of hearing to the threshold of pain) into the tidy range of 0 to 120 dB.
- Richter seismic magnitude: each additional unit represents wave amplitudes 10 times larger and energy released roughly 31.6 times greater.
- pH: pH = −log([H⁺]). A pH of 1 corresponds to a hydrogen ion concentration 10,000 times higher than pH 5.
log₂ — the binary logarithm
In computer science, log₂ is ubiquitous. The time complexity of a binary search in an array of n elements is O(log₂ n): to find one element among a million, at most 20 comparisons are needed (since 2²⁰ = 1,048,576). Shannon entropy, measuring the information content of a message, is expressed in bits using log₂.
Key properties (valid for any base b):
- log(a × b) = log(a) + log(b) — logarithms turn products into sums
- log(a / b) = log(a) − log(b)
- log(a^n) = n × log(a)
- Change of base: log_b(x) = ln(x) / ln(b)
The change-of-base formula is practical: a calculator that only offers ln and log₁₀ can compute any logarithm. For example, log₂(1024) = ln(1024) / ln(2) = 6.931 / 0.693 = 10. This checks out because 2¹⁰ = 1024.
// Computing log base 2 in JavaScript
function log2(x) {
return Math.log(x) / Math.log(2);
// or directly: Math.log2(x)
}
log2(1024); // → 10
6. Exponentials and powers
It is important to distinguish three types of expressions that the word "power" covers:
- x^n (integer power): 3⁴ = 81. The base varies, the exponent is fixed. This is polynomial growth.
- n^x (exponential with constant base): 2^x. The base is fixed, the exponent varies. Growth far faster than any polynomial.
- e^x (natural exponential): a special case of n^x with n = e ≈ 2.71828, but with a remarkable property: it is its own derivative. The derivative of e^x is e^x. No other function has this property.
The fundamental property of e^x
This self-similarity under differentiation makes e^x the natural solution to differential equations of the form dy/dx = k·y. Any quantity whose rate of change is proportional to itself evolves according to e^(kt). This covers bacterial populations (k > 0), carbon-14 decay (k < 0, half-life), capacitor discharge, and Newton's law of cooling (temperature of a cooling body).
Exponential vs polynomial growth: the algorithmic stakes
In algorithm design, the distinction between polynomial and exponential complexity is fundamental. For n = 100:
- O(n²) = 10,000 operations — fast
- O(n³) = 1,000,000 operations — still manageable
- O(2^n) = 2¹⁰⁰ ≈ 1.27 × 10³⁰ operations — computationally impossible
This is why NP-hard problems (like the Travelling Salesman Problem) cannot be solved in reasonable time for large instances: no polynomial-time algorithm is known for exact solutions.
// Illustrating comparative growth in JS
const n = 30;
console.log("n² :", n ** 2); // 900
console.log("2^n :", 2 ** n); // 1 073 741 824
console.log("e^n :", Math.E ** n); // 1 068 647 458 412
7. Factorial and combinatorics
The factorial of n, written n!, is the product of all integers from 1 to n. By convention, 0! = 1.
- 5! = 5 × 4 × 3 × 2 × 1 = 120
- 10! = 3,628,800
- 20! = 2,432,902,008,176,640,000
The factorial grows extraordinarily fast. Stirling's approximation provides an asymptotic estimate: n! ≈ √(2πn) × (n/e)^n. For n = 100, this yields a number with 158 digits.
Permutations, arrangements, combinations
Factorial is the foundation of combinatorics:
- Permutations of n elements: n! ways to order n distinct objects. Five books can be shelved in 5! = 120 different orders.
- Partial permutations (arrangements): P(n, k) = n! / (n−k)! — the number of ways to choose and order k objects from n.
- Combinations: C(n, k) = n! / (k! × (n−k)!) = "n choose k" — the number of ways to choose k objects from n without regard to order. C(52, 5) = 2,598,960 is the number of possible five-card poker hands.
Newton's binomial theorem uses combinations: (a + b)^n = Σ C(n, k) × a^k × b^(n−k) for k from 0 to n. The coefficients C(n, k) form Pascal's triangle.
In probability, combinatorics is ever-present. The probability of exactly k successes in n independent Bernoulli trials (coin flips, pass/fail tests, manufacturing defects) follows the binomial distribution: P(X = k) = C(n, k) × p^k × (1−p)^(n−k).
Need to generate random numbers for combinatorics simulations? Our random number generator can help with quick draws.
8. Essential mathematical constants
A handful of constants appear so often in mathematics and physics that they deserve careful attention.
π (pi) ≈ 3.14159265358979…
The ratio of a circle's circumference to its diameter. Known since antiquity — Archimedes bracketed it between 3 + 10/71 and 3 + 10/70 — π is irrational (Niven, 1947) and even transcendental (Lindemann, 1882). It appears in formulas that seem unrelated to circles: the Gaussian normal distribution, Euler's identity e^(iπ) + 1 = 0, and the integral ∫e^(−x²)dx = √π.
e (Euler's number) ≈ 2.71828182845904…
The base of the natural exponential. Discovered by Jacob Bernoulli in 1683 while studying continuously compounded interest: if you invest £1 at an annual rate of 100% compounded continuously, you end up with exactly e pounds after one year. Like π, e is transcendental (Hermite, 1873).
φ (golden ratio) ≈ 1.61803398874989…
The positive solution to x² = x + 1. It appears in the proportions of regular pentagons, in phyllotaxis (the arrangement of leaves and seeds — the spirals of a sunflower head), and in the Fibonacci sequence: the ratio of consecutive terms converges to φ. φ = (1 + √5) / 2.
√2 ≈ 1.41421356237…
The diagonal of a unit square. Its discovery as an irrational number by the Pythagoreans (circa 500 BC) was a philosophical shock — legend has it that Hippasus of Metapontum, who revealed this secret, was drowned by his fellow students. √2 is also the ratio of the long side to the short side of an A4 sheet (ISO 216 standard), a property that guarantees that folding an A3 sheet in half produces exactly an A4.
γ (Euler-Mascheroni constant) ≈ 0.57721566…
The limit of (1 + 1/2 + 1/3 + … + 1/n − ln(n)) as n → ∞. It appears in the analysis of the harmonic series, in the theory of prime numbers, and in many integrals in theoretical physics. Whether γ is rational or irrational remains one of the great open questions in mathematics.
9. Floating-point precision: the rounding trap
Every digital calculator, whether running on a computer or in a browser, represents real numbers approximately. The standard governing this representation is IEEE 754, published in 1985 and adopted by virtually all modern processors.
How IEEE 754 works
In double precision (64-bit, the JavaScript number type and C/Java double), a number is stored with:
- 1 sign bit
- 11 exponent bits (allowing exponents from −1022 to +1023)
- 52 mantissa bits
This yields approximately 15 to 17 significant digits of precision, and a value range from ≈ 5 × 10⁻³²⁴ to ≈ 1.8 × 10³⁰⁸. This format is remarkably precise for the vast majority of scientific applications.
Why 0.1 + 0.2 ≠ 0.3
The problem arises because some finite decimal fractions have no finite binary representation. Just as 1/3 = 0.333… is an infinite decimal fraction, 1/10 = 0.0001100110011… is an infinite binary fraction. The unavoidable truncation creates a rounding error:
// In any JavaScript console:
0.1 + 0.2;
// → 0.30000000000000004
// The correct way to compare floats:
Math.abs((0.1 + 0.2) - 0.3) < Number.EPSILON;
// → true
Number.EPSILON equals 2⁻⁵² ≈ 2.22 × 10⁻¹⁶, the smallest representable difference between 1 and the next representable number above 1 in double precision.
When floating-point precision is not enough
For financial applications (monetary amounts, VAT calculations, invoices), an error of a few 10⁻¹⁶ may seem negligible — but accumulated over millions of operations, it can produce accounting discrepancies. The standard solution: work in integers (cents) and convert to pounds or euros only at display time. In Java, BigDecimal provides arbitrary decimal precision. In Python, the decimal module offers the same capability.
For calculations in particle physics or astrophysics requiring more than 15 significant figures, quadruple precision (128-bit, __float128 in GCC) or arbitrary-precision libraries such as MPFR are available.
10. Scientific notation and large numbers
Scientific notation is the common language of all quantitative sciences. It rests on a simple convention: express every number as the product of a coefficient (between 1 and 10) and a power of 10.
Essential reference values
- 6.022 × 10²³ — Avogadro's number (N_A): the number of entities (atoms, molecules) in one mole of substance. Measured with record precision since the 2019 redefinition of the mole (now an exact fixed value).
- 3 × 10⁸ m/s — Speed of light in a vacuum (exact value: 299,792,458 m/s since 1983, which now defines the metre).
- 1.6 × 10⁻¹⁹ J — Electron-volt: the energy gained by an electron accelerated through a potential difference of 1 volt.
- 9.11 × 10⁻³¹ kg — Rest mass of an electron.
- 1.99 × 10³⁰ kg — Mass of the Sun.
Entering and reading EE notation
On a calculator or in a programming environment, EE (Exponent Entry) notation allows you to enter 6.022 × 10²³ as 6.022e23. This convention is universal: Python, JavaScript, C, MATLAB, Julia all use it. Conversely, a result displayed as 3.14159e-5 should be read as 3.14159 × 10⁻⁵ = 0.0000314159.
Unit conversion frequently involves scientific notation: converting nanometres to metres (1 nm = 10⁻⁹ m), light-years to metres (1 ly ≈ 9.461 × 10¹⁵ m), or parsecs to kilometres (1 pc ≈ 3.086 × 10¹³ km).
11. Classic calculation errors
Even with a perfect calculator, the user remains the primary source of error. Here are the most common pitfalls.
Order of operations (PEMDAS / BIDMAS)
The universal rule of operator precedence, memorised under different acronyms in different countries:
- PEMDAS (United States): Parentheses, Exponents, Multiplication, Division, Addition, Subtraction
- BIDMAS (United Kingdom): Brackets, Indices, Division, Multiplication, Addition, Subtraction
- BODMAS (also UK/Commonwealth): Brackets, Order, Division, Multiplication, Addition, Subtraction
Crucial point that is often misunderstood: in PEMDAS, Multiplication and Division have the same priority and are evaluated left to right. So do Addition and Subtraction. Therefore 12 ÷ 4 × 3 = (12 ÷ 4) × 3 = 9, not 12 ÷ (4 × 3) = 1.
Missing parentheses
Typing 1/2+3 instead of 1/(2+3) gives 3.5 instead of 0.2. This is the most frequent error with complex fractions. Best practice: add parentheses liberally, even when they seem redundant. (1) / (2 + 3) is unambiguous and equally valid.
Ambiguous minus sign
When entering −3², different calculators and languages may interpret this as (−3)² = 9 or as −(3²) = −9, depending on whether negation or exponentiation takes priority. Most calculators and programming languages interpret −3² = −9 (exponentiation has higher precedence). To obtain (−3)², type (−3)^2 explicitly.
Modulo of negative numbers
The result of −7 mod 3 depends on the convention: some calculators return −1 (C/Java/JavaScript: sign follows the dividend), others return 2 (Python/mathematical: result is always non-negative). In JavaScript: (-7) % 3 === -1. In Python: -7 % 3 == 2. This matters when working with negative angles or day-of-week calculations.
Division by zero
Mathematically undefined, division by zero is handled differently across systems: some display "Error", others return IEEE 754 Infinity (for 1/0) or NaN (for 0/0). Our calculator displays an explicit error message. If you encounter Infinity mid-calculation, check your inputs for an inadvertent zero denominator.
Forgetting units
Not a calculator error, but the costliest of all. In 1999, the Mars Climate Orbiter was destroyed in the Martian atmosphere because one team transmitted data in newton-seconds and another interpreted it in pound-force-seconds. One billion dollars and years of work lost to a unit mismatch. Always write the unit alongside every numerical value.
12. Conclusion: from calculator to mathematical mastery
Understanding advanced mathematical functions means far more than knowing which button to press. It means grasping intuitively why sin(π/2) = 1 while sin(90) in radian mode does not. It means knowing instinctively that ln is the right function for modelling exponential decay, and that log₁₀ is the right choice for a perceptual decibel scale. It means anticipating that a floating-point calculation involving 0.1 will carry a tiny rounding error, and knowing how to handle it.
The SAW TOOLS scientific calculator puts all the functions described in this guide at your fingertips — sin, cos, tan, their inverses, hyperbolic functions, ln, log, log₂, e^x, n!, and the constants π and e — directly in your browser, with no installation and no data collection. It operates in degrees, radians or gradians, and displays results in decimal or scientific notation.
To explore numbers in the context of simulations or probability, our random number generator complements the calculator well. For unit conversions involving powers of ten, the unit converter takes over seamlessly.
Mastery of scientific computing is one of the most valuable cross-disciplinary skills there is: it serves the engineer dimensioning a structure, the biologist modelling population growth, the developer evaluating algorithmic complexity, and the student preparing a physics or chemistry exam. It begins with understanding what each function actually does — and this guide gives you the foundation to do exactly that.