In hal component I would like to calculate sign of number - like sgn or signum, I found rtapi_copysign, but it takes 2 arguments.... and not sure how this work - I would expect something that takes only one arg... any hint?
maybe I could just write it like:
if (x > 0) return1;
if (x < 0) return -1;
but is there more appropriate way of doing it ?
Ah ok: copysign() takes the sign from one argument and the absolute value from the other