testArduino/fsfw/globalfunctions/sign.h

9 lines
137 B
C
Raw Normal View History

2021-06-21 15:04:15 +02:00
#ifndef SIGN_H_
#define SIGN_H_
template <typename T> int sign(T val) {
return (T(0) < val) - (val < T(0));
}
#endif /* SIGN_H_ */