# Probably because that was cheaper than another root-cause analysis

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.

"In the first parallel run, the newer hardware came up with a total payroll that was eight cents less than the run on the old hardware."

That leads to an intense effort over a long weekend to uncover the problem. And in the end, fish's team finds it.

It turns out that the eight-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 the rate is calculated in COBOL to nine decimal places. Then it's 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 eight-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!"

Sharky gives away stylish Shark shirts when he uses your true tale of IT life. Send it to me at sharky@computerworld.com. Add your comments below, and read some great old tales in the Sharkives.

Now you can post your own stories of IT ridiculousness at Shark Bait. Join today and vent your IT frustrations to people who've been there, done that.

Related:

``` ```