Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JLib.hh
Go to the documentation of this file.
1#ifndef __JEEP__JLIB__
2#define __JEEP__JLIB__
3
4/**
5 * \author mdejong
6 */
7
8namespace JEEP {}
9namespace JPP { using namespace JEEP; }
10
11namespace JEEP {
12
13 /**
14 * Get sign of value.
15 *
16 * \param value value
17 * \return -1 if value < 0; 0 if value == 0; +1 if value > 0
18 */
19 template<class T>
20 inline int sign(const T& value)
21 {
22 return (value > T(0)) - (value < T(0));
23 }
24}
25
26#endif
General puprpose classes and methods.
int sign(const T &value)
Get sign of value.
Definition JLib.hh:20
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).