fsfw/globalfunctions/sign.h
2016-06-15 23:48:49 +02:00

9 lines
137 B
C++

#ifndef SIGN_H_
#define SIGN_H_
template <typename T> int sign(T val) {
return (T(0) < val) - (val < T(0));
}
#endif /* SIGN_H_ */