# Technical Functions...!@#\$

• 12-08-2001
jinx
Technical Functions...!@#\$
Is there any header, lets say Math.h for example, that you could use to retreive the absolute value of a number. Technicaly, if I had the string:
75656
and I needed to subtract:

45562
and get:

75656
- 45562
---------------
30114
and so on. I would also need to compensate for other problems like:
34475
-52434
and return:

22041
I am pretty sure that some one could help me, the main goal is to get the positive value from subtraction of two integers. Or maybe I should use a strFormat and use a switch case method. Oh well, I've confused my self enough for one post. If this makes any sense whatsoever, please tell me so!
• 12-08-2001
Sebastiani
#include math.h

abs();
• 12-08-2001
jinx
• 12-09-2001
nvoigt
int abs( int ) from math.h returns the absolute value of the given number.

int i = abs( -8152 );

i is 8152
• 12-09-2001
jinx
However, I need to return a value like such:

Code:

```GetDlgItemValue(IDC_EDIT1, nInt); GetDlgItemValue(IDC_EDIT2, nInt2); int i = abs(nInt); int a= abs(nInt2);```
After this I would need to subtract the two but come out with the difference between each induvidual digit, assuming the two values are the same length. I think that i am now leaning toward more of a strFormat approach. What do you think?
• 12-09-2001
zen
..or you could do -

int whatever = abs(nInt - nInt2);