In the last 5.00.9995 version I was happy to find a new compare that let you show percentage diff between two tables.
Now if in one or both of the tables are zero values, it has as result: -nan(ind)%
Value in the map is an integer, 2 bytes
New % compare fails when one othe the compares is zero
Moderators: Mangus, robertisaar, dex
-
- Posts: 29
- Joined: Sat Aug 31, 2013 7:27 am
Re: New % compare fails when one othe the compares is zero
I would assert that this is the desired behavior.
If the original value is 0, but the compare value is, say, 20, what is the percent difference?
If the original value is 20, but the compare value is 0, what is the percent difference?
Mathematically, they're infinity which has no meaning in percentages. For the first situation, right now "100%" is displayed, which isn't right either, really. 20 is not 100% of 0.
I could change the NaN (not a number) to something easier to decipher, I suppose. What should that be? "Inf"? "?"? "Existential Challenge"?
I'm thinking "?"
Let me know your thoughts. =)
If the original value is 0, but the compare value is, say, 20, what is the percent difference?
If the original value is 20, but the compare value is 0, what is the percent difference?
Mathematically, they're infinity which has no meaning in percentages. For the first situation, right now "100%" is displayed, which isn't right either, really. 20 is not 100% of 0.
I could change the NaN (not a number) to something easier to decipher, I suppose. What should that be? "Inf"? "?"? "Existential Challenge"?
I'm thinking "?"
Let me know your thoughts. =)
***************************************
TunerPro Author
1989 Trans Am
TunerPro Author
1989 Trans Am
-
- Posts: 29
- Joined: Sat Aug 31, 2013 7:27 am
Re: New % compare fails when one othe the compares is zero
The zero is a special thing in calculations.
When both values are 0, the outcome is also -nan(ind)%
When original value is 0, and compare 1024, result is 100%
When original value is 1024 and compare 0, result is -inf%
I would tend to 0% as outcome.
I wasn't aware that NaN is not a number. I had see it in other environments too. Maybe SQl server?
When both values are 0, the outcome is also -nan(ind)%
When original value is 0, and compare 1024, result is 100%
When original value is 1024 and compare 0, result is -inf%
I would tend to 0% as outcome.
I wasn't aware that NaN is not a number. I had see it in other environments too. Maybe SQl server?
Re: New % compare fails when one othe the compares is zero
When both are 0, the output should be 0%. I'll fix that case.
***************************************
TunerPro Author
1989 Trans Am
TunerPro Author
1989 Trans Am