- 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
2.5000 is the new 2.500?
Admin
So TRWTF is that Andy can't handle fixed-point math?
Admin
Once the sales manager cleared the scene, he rounded his desk, gathered up the invoices, and reached for his nearest resume.
FTFY
Admin
I'm personally curious how he managed to store 2.5 in a 16 bit int.
Admin
The sales manager had a row with his boss & then he took the sales managers word on it without speaking to his boss directly?
That really is stupid
Admin
5000th post!
Admin
Aaah, the good old days of 6502 assembly. I still have a C64 hidden somewhere in my house for sentimental reasons. Ofc in those days i didn't have to worry about invoice printing. I was just a kid trying his hands on this new thing called personal computers and programming. Which meant playing Fort Apocalypse, Impossible Mission and Aztec Challenge a lot. Until the boredom set in and i wanted to make my own games. That is how it all started for me. In the end there was no great games programming career for me, but now there a customers complaining about the layout of their invoices. I should get back to work.
Admin
Admin
He's obviously not very smart, all he had to do was write a single line to the invoice 'all tonnage values must be multiplied by 1000 for actual values'
Admin
"Figure it out, and give my customers a readable print-out!"
I only hope that all the sales manager's personal customers are clearly marked in the database. Otherwise that feature request is impossible to implement...
Admin
This is a very sad story.
Admin
Or just "all values are in European standard kilotonnes"
Admin
So many WTFs!
But in the article itself...
I can't understand why anyone would write invoicing software for a PET 4032 in assembler, when the built-in basic handled that sort of task perfectly well. Writing assembler for a PET was not trivial - machine code directly entered in hex was not uncommon for speed, but assembler generally required a whole load of messing around.
Also, I wrote accounting software at about this time and I never saw anyone print invoices on green-lined paper!
On top of all of this - thinking that "adding three zeroes" to the number would give the correct answer makes Andy TRWTF!
Admin
What's the problem? 2 in a byte, 128 in another - voilá!
Ever heard of fixed-point math?
Admin
Also TRWTF is that Andy can't handle fixed point math. The least he should do is check how many zeroes actually must be appended for a correct conversion.
Admin
TRWTF is someone writing that kind of software in the early 1980s for an 8-bit computer in something other than Basic.
And the only kind of green-, blue-, or brown-lined paper I remember from back in the day was used to print out source code or listings, not documents for customers, but maybe such a thing was done somewhere vOv.
Admin
The easiest option, is multiply the quantity by 10 and convert to int, then add 2 0's hard coded into the printout.
Admin
When I was your age, everything was greenbar and we liked it!
Then some weenie invented 8 1/2 x 11 white paper, with perforated strips along the edges that you could tear off. Which was all fine and dandy, except the printer was wide enough for greenbar and the white stuff didn't fit. Then you needed adjustable roller thingies. Then someone would spool a job without realizing there was white paper in the printer, and it would print right off the edge. Devil spawn, I tell you! Give me back my greenbar!
You young 'uns missed out. Why you could walk around with a wad of greenbar tucked under your arm, and it was as good as a roll of hundred dollar bills. Chicks instantly realized that you were in the big-money computer business, a rising star!
Admin
I call shenanigans! Anyone who was there knows that every report had as much info as possible crammed into the inflexible limit of 132 columns. There's no way you could add three zeros, or even one, to anything without running out of room.
Basically any requirements session boiled down to "if we cut off the last name at 8 characters we can add four digits to the zip code -- is that what you really want?"
Admin
Should be, "Gathered up the invoices, shredded them, restored the code to the original form, and then went home for the day. Later that week, the sales guy tried to get Andy fired, but ended up having his ears thumped by management. Everyone else was happy!"
Admin
The easiest option is to multiply by 1000!
Admin
Sorry, but Andy is in the wrong here. Maybe the guy was as much as a dick as his story says, but he did nothing to explain the problem. And on top of that, his solution was wrong.
Admin
This is why nothing should be changed without getting people to sign off in writing. Also having a nice three week minimum turn around for change requests typically reduces the amount of issues that really need to be worked. Didn't review the changes in our test environment? Guess you will have to live with it for a few weeks.
Admin
This is why nothing should be changed without getting people to sign off in writing. Also having a nice three week minimum turn around for change requests typically reduces the amount of issues that really need to be worked. Didn't review the changes in our test environment? Guess you will have to live with it for a few weeks.
Admin
So, without the decimal place, 2 becomes 2000 but 2.5 becomes 25000, that there is the REAL WTF!
Admin
Admin
I take it the WTF is how poorly Andy handled this situation?
Slap on an extra three 0's, really?
Admin
Umm... I think you might have missed something...
Admin
Waidaminute...
Doesn't an invoice usually take the form of:
Item A Qty of A x Unit Price of A = Amount of A Item A Qty of B x Unit Price of B = Amount of B Item A Qty of C x Unit Price of C = Amount of C Grand total
Presumably the unit prices were all in kilotons before, so if Andy just changed the way the quantities were display without also changing the unit prices, the invoice would be all kinds of messed up. TRWTF is that the company let Andy anywhere near any sort of maths. Maybe he should have been fired.
Admin
What the hell were they selling hundreds of thousands of tons of?
Admin
Is it really that hard?
Admin
Toenails.
Admin
Just got done loading two new boxes of greenbar into our ancient beast, so I am getting a kick out of this.
Admin
I could go on, but I have a website to read.
Admin
you obviously didn't ever hear about fixed point decimals.
Admin
The first 5 comments are good comments! What has happenned to this site?
Admin
The Real WTF is Andy.
Uses hack, creates inconsistent output that is confusing and makes the problem worse than before. Acts like a bit of an arse to boot.
Should have said it wasn't possible, and explained why.
Admin
You certainly could do fixed point math, but this specifies that the largest value he could store in his 16 bit word is 65536 - which means he's using unsigned integers.
In reality, they probably did use fixed point math and "TRWTF" is all the errors introduced during the re-writing of submissions.
Admin
Pretty story, but TRWTF is Andy being to lazy to do its actual job, or being able to stand his ground (who changes customers invoices snapping his fingers ?).
Whatever...
Admin
Admin
As well as tipp-ex we used to have liquid paper.
Pretty-printing of numbers is tricky. Anyone want to try it in their favourite language?
My guess is that they were storing "fixed point" numbers if they allowed 2.5
Admin
This sounds like a fairly trivial problem to solve, even in 6502 assembly, I get the impression this guy is just lazy. If the same invoice printing code is in 600 different places, write a set of find/replace expressions? Original submitter, please feel free to chime in on how the editor messed up your story.
Admin
I can confirm that to this day Walmart still prints out accounting totals on green-lined paper on dot matrix printers.
Admin
Admin
You fascists!
Admin
Wite-Out, no h. https://en.wikipedia.org/wiki/Wite-Out
Admin
I miss greenbar; I miss making little springs out of the perforated edges sigh
Admin
Non-pertinent but interesting information here: https://en.wikipedia.org/wiki/Correction_fluid
Admin
So, he didn't get confirmation from his boss, his solution was laughably wrong and terrible, he acted like even more of an ass than the sales guy at the end, and then decided to use wite-out instead of fix the code properly and leave for the day? TRWTF is Andy. Also someone needs to teach the new writers that we like our HTML comments.
Speaking of writers... "Because he wanted to knock off at 3:02, obviously." Knock off...? As an American, the only thing that means to me (when it doesn't take an object, i.e. "knock it off") is to copy something (possibly cheaply), so what is the author trying to say here?
Admin
The real problem is that 2.5000 is wrong. He added three 000 to both 2 and 2.5 which gets you 2 thousand and 25 thousand. Also, if this was for Europe it should have been a comma in the abbreviated version. TRWTF is the fail programmer.