Flashback Friday: Give them a headache and they might be generous

But we bet they’ll find a way to get that 8 cents back.

Computerworld  |  Shark Tank
Computerworld / IDG

It’s the mid-1980s, and this pilot fish is working on a project to convert his company’s payroll system from one proprietary mainframe to a newer model.

“After converting the system, we did parallel runs for the same week between old and new hardware,” says fish.

And lo and behold, the newer hardware comes up with a total payroll that’s 8 cents less than the run on the old hardware. An intense effort over a long weekend is required to uncover the problem. What fish’s team finds in the end is that the 8-cent difference is spread among three hourly employees— the only people who received pay raises that week.

Digging into the calculation of the hourly rate, fish and his team discover that it’s calculated in COBOL to nine decimal places, and then rounded to three decimal places in an unusual way: The last six decimal places are split off, and if the value is greater than zero, the third decimal place is rounded up by one.

With more digging, the team finds that for all three employees who got raises, those last six decimal places are zero. The new system correctly leaves the hourly rates alone — but the old system is rounding them up, which is where the 8-cent difference comes from.

But why? Still more digging, and the team realizes the answer is the new hardware.

“The new hourly rate was initially calculated as a signed field,” fish explains. “On the new hardware, the sign bit was over the most significant digit of the number. But on the old system, the sign bit was carried over the least significant digit — the ninth decimal place.

“So when they separated out the last six decimal places, those digits were always greater than zero — and thus always rounded up. The old payroll system had been running for years, and no one had ever caught this.

“And payroll's solution to this? They said, ‘Just have the new system always round up by one.’

“Yes, it's true — for once, the bean counters gave away money!”

Feed the Shark! Send me your true tales of IT life at sharky@computerworld.com. You can also subscribe to the Daily Shark Newsletter.

Copyright © 2019 IDG Communications, Inc.

7 inconvenient truths about the hybrid work trend
Shop Tech Products at Amazon