New % compare fails when one othe the compares is zero

Report bugs found in TunerPro. Please be sure to include as much info as possible, including system specs, OS, repro steps and TunerPro version number.

Moderators: Mangus, robertisaar, dex

Post Reply
pauldaytona
Posts: 29
Joined: Sat Aug 31, 2013 7:27 am

New % compare fails when one othe the compares is zero

Post by pauldaytona »

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
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Re: New % compare fails when one othe the compares is zero

Post by Mangus »

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. =)
***************************************
TunerPro Author
1989 Trans Am
pauldaytona
Posts: 29
Joined: Sat Aug 31, 2013 7:27 am

Re: New % compare fails when one othe the compares is zero

Post by pauldaytona »

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?
User avatar
Mangus
TunerPro Author
Posts: 1926
Joined: Wed Mar 19, 2003 1:49 pm

Re: New % compare fails when one othe the compares is zero

Post by Mangus »

When both are 0, the output should be 0%. I'll fix that case.
***************************************
TunerPro Author
1989 Trans Am
Post Reply