1 = 2

May. 13th, 2014 03:09 pm
plonq: (Derpy Mood)
[personal profile] plonq
When does -40 = -41? When you copy a formula over from version 3.1 of some software to version 4.0 of the same.

I not write the formulas that created those numbers, and if I had, I'd have written them differently anyway. The fact remains that the software that we are using to produce this report has changed the way it handles its rounding from one version to the next.

The formula is taking a performance metric from one year and subtracting it from the previous year to show the variance year over year. When I expanded the two base numbers, this is what I got:

This year: 14.450
Last year: 54.941

When you subtract last year from this year, you get -40.491

The current version of the software correctly rounds that down to 40 when we strip away the decimal places. But wait, when we round all three numbers we get 14 - 55 = -40. In the old version it yielded -41.

What this tells me is that the old version of the software was probably rounding the numbers before it did the subtraction, rather than doing it at the end. In their own, stupid ways, both versions of the software are correct.

And I am left with a report that yields different results from the same source data, depending on which program I use to produce it.

It will be labour intensive, but the only solution I can see at the moment is to redo the formulae and truncate each term, rather than truncating at the end. That should only take most of tomorrow.

Date: 2014-05-13 09:29 pm (UTC)
From: [identity profile] pierrekrahn.livejournal.com
"When you subtract last year from this year, you get -40.491
The current version of the software correctly rounds that down to 40"

Would that be "rounds that UP to -40"?

Date: 2014-05-13 10:35 pm (UTC)
From: [identity profile] plonq.livejournal.com
You are technically correct, but when it comes to rounding I tend to think in absolutes, so whatever brings it closer to zero is rounding "down" in my mind.

August 2025

S M T W T F S
     12
3456789
10111213141516
171819202122 23
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 6th, 2026 03:15 am
Powered by Dreamwidth Studios