Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way with the ABS() to show % of the differenc
Message
From
03/11/2000 11:54:28
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00437296
Message ID:
00437714
Views:
28
>>>>I want to get the abs(num1 - num2).. and have the result
>>>>be a percent..for example...
>>>>?abs(12-14)... the result is 2, but what percent is 2 of the two numbers?
>>>
>>>The larger or the smaller? For the range of non-negative real numbers:
>>>
>>>? 100*ABS(a-b)/MAX(a,b) && % larger
>>>? 100*ABS(a-b)/MIN(a,b) && % smaller
>>>
>>>The math changes when you encompass negative numbers treating size as their scalar distance from 0 (you need to use ABS(a) and ABS(b)) or you start dealing with other than real numbers.
>>----------------
>>Hi Ed...I no what you mean. I am having problems because I do have negative
>>numbers and NULL values. What can I do to fix this problem? ...:)
>
>Is the difference of (2,-10) 12 or 8? NULLs are handled by using NVL() to substitute a 0 value.
---
The difference is 8...thanks for your help...:)
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform