That seems like thinking it ironic that lawn mowers have a place to put blades for cutting grass.
The idea that there’s a huge wrapper around the CPUs core functionality is indeed weird because you would expect that functionality to be available without any program at all.
A more apt analogy in this case would be a car having pedals.
Obviously, a prompt that accepts arbitrarily complicated mathematical expressions and returns a value is a far superior interface than clicking on buttons with a mouse, but skeuomorphisms in design are very common place, in spite of their lesser efficiency.
(This obviously misses the point that we made computers usable by mostly anybody along the way, but it’s still funny)
- planning a program
- implementing missing mul and/or shl instructions in your mind
- managing register pressure for more complex expressions
- having to start from scratch on a mistake
- debugging with a multimeter
Even if you think of MBR-style calculator, there is at least dozen kb BIOS and dozen kb VGA BIOS to start with a blank screen that can do cursor and digits. There is nothing cheap or straightforward down there, and the first thing people did was abstracting baremetal away ASAFP.A modern CPU has got the calculation part covered by itself, but it still needs the UI. Of course there are other kinds of UI for people to do calculations - for example Excel, or programming language REPLs - but desk calculators had pretty good UI for some use cases, so it makes sense to have an option based on them.
A more apt comparison would be having a 40ft tall Mech that transforms into a jet and flies from neighborhood to neighborhood then crouches down and uses a tiny pair of scissors to cut the grass.
Transposing the metaphor of a desk calculator verbatim is inefficient and unproductive, graphical gimmick exclusively. Unix bc, which predates Windows calculator by a couple decades, is Turing-complete and in fact close to a full-featured modern dynamic language.
Today's equivalent would be a {python|ruby|node|perl} REPL.
Accessibility is everything. I would guess the skeuomorphic calculator apps have 5 orders of magnitude more users than bc, and 4 more than the REPLs (not that the REPLs were even built for this purpose).
I think they will evolve over time away from skeuomorphism, but not into anything resembling a plain REPL.
Also, the UX of a REPL sucks because it lives in a white-on-black terminal and prints scary version messages about a thing called "clang". Do the same thing with nice colors and friendly messages and I doubt the usability would be any worse.
Engineers fall into this trap a lot - projecting our own preferences onto what we think other people should find accessible. Most people require training before they can use Excel. The training required to use a calculator is so minimal, they teach it in elementary school. And a REPL is gibberish to the vast majority of people, even if you dress it up with nice colors and friendly messages (which to be fair help a lot).
For a refreshingly modern take on calculator apps, take a look at something like Soulver/Numi/Calca which use a notebook-style interface, or SpeedCrunch which uses a REPL-style interface (and which does have a keypad, but you can turn it off).
If the idea of a calculator app just seems ugly to your brain, PowerShell does floating-point math and is scriptable to boot. I've used it as a calculator in the past, though it means having to put up with some wonky syntax.
I'm sure all tools you suggest are great, but as someone who can program, I can just use the REPL of whatever programming language I'm using at the moment. I have no need for a dedicated tool in the first place.
How would a non technical person do a square root or exponent? It's not obvious to type sqrt(2) or 3^4 into a text field, and people shouldn't have to read a manual to use a calculator. The default calculator is meant for the average person, and advanced tools are available for the rest.
Powershell says 0.2,
calc.exe app and libreoffice calc agree with 0.2,
BC running in CYGWin also 0.2,
Python 2 and 3 answer 0.19999999999999998,
JS in Vivaldi and firefox also answer 0.19999999999999998,
But Portacle (Common Lisp) returns 0.20000002
- if you get 0.2, the code is using rational numbers or a custom implementation
- 0.199999...8 is the double precision IEEE subtraction.
- 0.200000...2 is the single precision IEEE subtraction.
This looks like a typecasting/coercion issue. You can likely get all of the above in C++ or Java by using different explicit casts.
IIRC, there are languages that use IEEE double precision but the way they handle default display presents this as 0.2 (basically, they use a display algorithm that displays the shortest decimal expression that has the same double precision representation.)
jshell> new BigDecimal("0.3").subtract(new BigDecimal("0.1"))
$8 ==> 0.2 jshell> .3f-.1f
$1 ==> 0.20000002
We got ourselves a hat trick :)Floating point implementations can vary not only between languages, but also between different CPUs, if the language relies on the hardware implementation (which is the smart thing to do in most cases).
As a side note: Python's implementation of FP isn't standard-compliant. E.g. when you divide by 5.0 by 0.0, the standard says you should get a +inf. In Python you get an exception.
In [1]: from decimal import Decimal as D
In [2]: D('0.3') - D('0.2')
Out[2]: Decimal('0.1')[1] https://medium.com/@raiph_mellor/fixed-point-is-still-an-app...