Hello, I'm STM8S user.
I doing find the STM8S math.h, math.s in stm8s code example.. But i dont find it,,
I want to use ABS(X) ,, ABS(X) isnt there in math.h?
Hello Lee Young Jun,
if you cannot find ABS function, you can make your own:
#define ABS(x) ((x) > 0 ? (x) : -(x))
I guess you want to use abs(). The name is in lower-case, and it is in stdlib.h.
P.S.: However, if you want to handle floating-point numbers, you should use fabsf(), which is in math.h. Variants for different types exist both for integer (labs(), llabs()) and floating-point (fabs(), fabsl(), but those don't matter on STM8 as no current compiler supports double or long double).
Retrieving data ...