Do the math…
While pursuing my master’s degree, I had a research assistant position at a university-affiliated lab. The group I worked with specialized in antennas and radio-frequency topics. Much of what I did there related to modeling of antennas on computer simulations. Since it was the late 80s, this was not particularly advanced computing. Some departments, including ours, had their own mini-computers, which were powerful enough to handle the department’s need but also small enough to be maintained by the department. IIRC, ours was a DEC PDP-11.
One morning, I completed a new simulation and ran it. The data I got back was obviously odd. I checked my input and some parts of the program and ran it again, with the same result. I think I ran some older simulations, which I knew had worked, as a comparison and they too yielded odd results. Then I ran some more fundamental checks, but still got output that I thought was wrong. At some point, I coded the following in order to start from the most basic level:
For x = 1 to 10
Print x, ‘…’, 3*x;
Next
This is an approximation, but the syntax was correct as the compiler approved it. I then ran the program and saw the following output:
1 … 3
2 … 6
3 … 9
4 … 12
5 … 15
6 … 18
7 … 21
8 … 24
9 … 21
10 … 30
Now, even at that time I had worked with computers enough to know that errors were almost always with the programmer, not the computer’s hardware. I read the code again and ran it again (maybe twice) just to ensure that the output was at least consistent; it was. I sat there for a minute absorbing the implication. The computer itself recognized the number ‘9’ yet somehow lacked the ability to utilize it in a mathematical operation and (in just that one case) substituted a value of 7 in its place. That seemed pretty unlikely, but I couldn’t reach any other conclusion based on what I saw.
Reluctantly, I got a hard-copy of my 3-line program and the output, and then walked down the hall to the guy who managed the department, as he was the only other person there at the time. I knocked and went into his office. I explained briefly what had happened and what I thought was going on. He had a sort of bemused expression towards the end of my story, and then asked to see the print-out. I think he assumed that I was misguided and that he’d quickly spot my error and educate me about how computers worked, etc.
He read the page I handed him and stopped smiling. I could see him going through the same sort of mental process I had, re-reading it and trying to find some obvious flaw. He suddenly laid the page down on his desk, got up, and walked out of his office.
I learned later that the night before, the staff had installed a new math co-processor in the department’s mini-computer. The purpose of the co-processor was to speed up computations. My roommate and I were amused by this, and agreed that it must have at least sped up operations by 10%, as it no longer had to keep track of 10% of the actual numbers (the 9s). The department manager later thanked me for bringing this to his attention.