- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Wait, how "2.5000" correct? It should have been "2.500".
And does Andy actually know the manager said it? What if the sales manager lied about getting Andy's approval for the change?
Also, Andy didn't point out (at least from the text of the article) the technical limitation precluding the writing out of the tons to the sales manager. That would be a good argument to use to push back at the request, if Andy had the opinion that the change is not warranted.
Admin
I thought the very last sentence was going to read "... and reached for the nearest bottle of booze".
I suppose the real point of this story is that ignorant PHBs are at least 40 years old in IT.
Admin
Of course, it all was discussed back in 2012. TL/DR, Andy is TRWTF, adding three 0s is BS (European or not), and how they put fractional values in a 16 bit int is just as unexplained as why the editors chose this one of all the articles.
Admin
The real reason: I pick classics by hitting "Random" until an article that seems fun pops up.
Admin
Ah, “Classic” in the “we’ve seen this before” sense, rather than “This is an archetype of its class and will stand the test of time” sense…
Admin
To be fair, even in 1982 I'm more worried about them using assembler for reports. Or was that normal at the time?
For me it sounds like maintaining a legacy code base with odd choices, that may go back to extremely limited resource constraints and/or lack of understanding of maintainability concerns, that really aren't THAT much of a WTF given the year it happened.
Admin
The story seems to involve a Commodore PET 4032 used to print invoices back in 82. Assembly seems like a proper choice for that time and the type of machine. Not many compilers were available that could fit the machine's resources and were actually affordable. If a company would have invested in a C/Pascal/Fortran compiler, they would probably not have been using a PET to begin with.
Admin
They probably had the values stored as floating point = 16 bit mantissa and (probably) 8 bit exponent. When converting to strings they would normalise the exponent to 0 and the mantissa would overflow if greater than 65535.
Converting floating point numbers to strings is hard.
Admin
BASIC was available on a 4032 for free. They could easily have written the invoice printing code in BASIC.
Admin
Integers are exact. Floating point numbers are inexact especially the 24 bit versions with a 16 bit mantissa. That means tha once one value is about 32000 times another, adding or subtracting the smaller value has no effect .. as abused in some rounding based frauds back in the day..
So the decision to store scaled integers makes sense.
Admin
Fixed point math, 16bit "upper" and 16bit "lower" part. It was popular even on 90's when processors with fp were not so common/affordable.