A Useless Bug in a Calculator
My favourite calculator has a bug in the input display. It allows for some fun overlapping of text on the display, as well as an invisibility trick.
First I will start with some background, however since background is boring skip to the interesting things here. If I haven’t added more yet, it should be sufficient to skip two paragraphs. Or just look at the oversized images.
Introduction
I have recently been reminded by a change in policy by my university to allow some other calculators to be used in exams that I have a calculator that has what can possibly be described as a bug. By some I mean not this one, this one is not on the list. I wish it was because it is my favourite basic scientific calculator. I first got it when I went to high school and it has served me well since. It was during the final years of high school that I discovered this bug during a maths exam, and wasted most of that exam exploring what it could do.
Because I will be describing what this bug is and how it works I will need to include some pictures, which right now is a pain because due to it’s advanced age the batteries in it have finally run completely dry. So if you’ll excuse me for a moment I need to get some batteries for this thing.
Be Interesting
The calculator is the SHARP EL-W531. The bug is in the display of the input, the output is still fine. The bug is displayed in the image below.
Because that can be a bit hard to see, I will convert the image into just a display of the pixel data, like shown below.
But what is that showing? It’s showing (ANS²) but the right bracket and the S from ANS are overlapping.
Now I don’t know how hard this will be to illustrate, but I will give it a go. So first is how the square operator works and displays on the screen.
When a number is entered in this place, it works as expected. However, when ANS is answered, the square symbol is in the expected position, but the right bracket only moves as it would if ANS was 1 character long. Hence the S from ANS overlaps with the right bracket. Additionally if the squared symbol is deleted, this bracket remains 2 places in front of where it should be, now over the N.
ANS can then be deleted, the right bracket is now in a very weird position, this causes neither to render at all. I don’t think I need to include a picture of what this looks like. If you place a symbol inside the bracket, this displays as normal. If you then place a symbol outside the right side of the bracket, it places it on top.
Performing this technique twice in one bracket allows for a single symbol to be hidden off the left of the screen. This leads me to a stupid thing (as if the rest of this isn’t stupid), π = 3.
The full input of the display would read (A)×π, should the input not be strangely shifted.
Why?
I don’t know how the code is written, but I’d imagine it’s something to do with an optimisation made to make rendering brackets quicker. Rather than recalculating the position of the brackets every time, it instead keeps track of how much the inside of it expands and contracts by and uses that information to come up with where to position itself. If ANS is placed inside a square, the bracket is told to increase by 1.
If something is placed or removed from a bracket that changes the height of the display, for example a fraction or a general power, a full recalculation on the position of the brackets is performed. This places them back in the correct positions.
Additional details
This doesn’t only work with brackets, it also works with square roots! If this is done to a square root, removal of the square and ANS will make it disappear. This can also hide a single symbol inside it.
However, far more interestingly, if you place a symbol in front of the square root…
… that happens.