DEV Community

Cover image for ๐Ÿงฎ Scientific Calculator: DEG ยท RAD ยท GRAD, memory keys, and a tape you can edit
Tomaz
Tomaz

Posted on Originally published at tooladda.online

๐Ÿงฎ Scientific Calculator: DEG ยท RAD ยท GRAD, memory keys, and a tape you can edit

โšก 10-second version

A calculator that doesn't lose your work. Every entry lands on an editable tape at tooladda.online/scientific-calculator.html โ€” so when you mistype step four of a nine-step calculation, you fix step four instead of starting again.

โ— Important

Install it once and it works with the network off. On a phone in an exam hall, on a plane, or in a lab with no Wi-Fi, a calculator that needs a connection is not a calculator.


โš ๏ธ The two mistakes that ruin real answers

1. Wrong angle mode โ€” the silent wrong answer

This is the single most common source of "the calculator is broken". It isn't; it's in radians when you meant degrees.

You type In DEG In RAD
sin(30) 0.5 โœ… -0.988031624... โŒ
tan(90) error / โˆž -1.9952...

Both answers are correct arithmetic. Only one answers your question. The current mode is shown permanently in the display here, because a mode indicator you have to go looking for is a mode indicator you'll forget.

2. Floating-point reality

Every calculator on every computer stores numbers in binary IEEE 754 doubles, and some decimals simply don't exist in binary:

0.1 + 0.2        โ†’  0.30000000000000004
0.3 โˆ’ 0.1        โ†’  0.19999999999999998
sin(ฯ€)           โ†’  1.2246467991473532e-16     (not exactly 0)
tan(89.9999ยฐ)    โ†’  572957.795...              (blowing up toward โˆž)
Enter fullscreen mode Exit fullscreen mode

This is not a bug in this tool โ€” it's how binary floating point works, everywhere, including Excel and your phone. Knowing it means you stop chasing a 4 in the seventeenth decimal place and start rounding at the precision your problem actually has.


๐Ÿงญ How the tape changes things

Diagram

That loop back from the tape into the parser is the feature. A normal calculator has no way to draw that arrow.


โœจ What's inside

### ๐Ÿ“œ Editable calculation tape Every step is kept and every step is editable. Correct one line and everything downstream recomputes โ€” the way a spreadsheet behaves, in a calculator's form factor. ### ๐Ÿ“ Full function set `sin` `cos` `tan` and inverses, `log` `ln` `exp`, powers, roots, `n!`, `nCr` / `nPr`, ฯ€ and e, reciprocals, percentages.
### ๐ŸŽš๏ธ DEG / RAD / GRAD Always visible, one tap to switch. GRAD included for surveying and some engineering coursework where 400 gradians to a turn is still standard. ### ๐Ÿง  Memory keys `M+` `Mโˆ’` `MR` `MC` behaving the way a physical scientific calculator behaves โ€” no relearning.
### โŒจ๏ธ Real keyboard support Type expressions with the number row and operators. On a laptop, typing beats clicking buttons with a mouse every time. ### โœˆ๏ธ Installable PWA Add to home screen, open with no connection. No ads, no popups, no cookie banner between you and an answer.

๐Ÿ› ๏ธ Who reaches for it

Situation Why this one
๐ŸŽ“ Students doing physics or maths homework The tape shows your working โ€” which is half the marks.
๐Ÿ—๏ธ Engineers checking a quick figure DEG/RAD/GRAD without hunting through a settings menu.
๐Ÿงช Lab work Offline on a bench machine with no internet access.
๐Ÿ’ฐ Anyone doing multi-step money maths Fix an early step without re-entering eight numbers.
๐Ÿ“ฑ Phone users who don't want another app Install the page instead of installing an APK full of ads.
๐Ÿง‘โ€๐Ÿซ Teachers demonstrating on a projector Large, readable display and visible history for the class to follow.

๐Ÿ“– Getting the most out of it

1.  Open    โ†’  tooladda.online/scientific-calculator.html
2.  Check   โ†’  the angle mode indicator BEFORE any trig
3.  Type    โ†’  use the keyboard, not the mouse
4.  Edit    โ†’  click a tape line to correct it, don't restart
5.  Install โ†’  browser menu โ†’ Install / Add to Home Screen (for offline)
Enter fullscreen mode Exit fullscreen mode

โ–ถ Open it now โ€” tooladda.online/scientific-calculator.html

๐Ÿ’ก Tip

Round at the end, not at every step. Rounding intermediate values is how a chain of correct operations produces a visibly wrong final answer โ€” and the editable tape lets you keep full precision until the last line.


โ“ FAQ

Is it free and ad-free?

Free, and no interstitial ads or popups. No signup either.

Why does 0.1 + 0.2 not give exactly 0.3?

Binary floating point can't represent 0.1 or 0.2 exactly, so the sum lands a hair above 0.3. Every mainstream calculator and spreadsheet has this property; some hide it by rounding the display. Knowing about it is more useful than hiding it.

Why is sin(ฯ€) not zero?

Because ฯ€ itself is stored as a finite approximation, so you're taking the sine of almost ฯ€. The result is about 1.22 ร— 10โปยนโถ โ€” mathematically zero for any practical purpose.

What is GRAD and do I need it?

Gradians: 400 to a full turn instead of 360 degrees. It shows up in surveying and some European engineering syllabi. If you've never needed it, you don't.

Does it work offline?

Yes. Install it as a PWA and it opens and computes with no connection.

Can I use my keyboard?

Yes โ€” digits, operators, parentheses, Enter to evaluate, Escape to clear.

Can I copy the whole calculation out?

Yes, the tape can be copied โ€” useful for pasting your working into homework or a report.


๐Ÿ”ฌ Under the hood

  • Vanilla JavaScript expression parser โ€” no eval(), so a pasted expression can't execute code.
  • IEEE 754 doubles, like every other software calculator; display precision is handled separately from stored precision.
  • Service worker + web manifest for genuine offline use.
  • Covered by unit tests, because a calculator that's occasionally wrong is worse than no calculator.

Originally published on ToolAdda, where Scientific Calculator runs free in your browser โ€” nothing is uploaded, nothing leaves your device.

Top comments (0)