9 #ifndef YARP_CONFIG_NUMERIC_H
10 #define YARP_CONFIG_NUMERIC_H
12 #define YARP_HAS_SYS_TYPES_H
14 #if defined(YARP_HAS_SYS_TYPES_H)
15 # include <sys/types.h>
22 #if defined (_MSC_VER)
27 #define YARP_LITTLE_ENDIAN
29 #define YARP_HAS_FLOAT128_T
30 #define YARP_FLOAT32_IS_IEC559 1
31 #define YARP_FLOAT64_IS_IEC559 1
32 #define YARP_FLOAT128_IS_IEC559 1
36 #if defined(float32_t)
39 #if defined(float64_t)
42 #if defined(float128_t)
53 #if defined(YARP_HAS_FLOAT128_T)
57 #if defined (_MSC_VER)
65 constexpr
const T&
clamp(
const T& v,
const T& lo,
const T& hi )
68 return (v < lo) ? lo : (hi < v) ? hi : v;
71 template<
class T,
class Compare>
72 constexpr
const T&
clamp(
const T& v,
const T& lo,
const T& hi, Compare comp )
75 return comp(v, lo) ? lo : comp(hi, v) ? hi : v;
82 #define YARP_FLT_EXP_DIG 3
83 #define YARP_DBL_EXP_DIG 4
84 #define YARP_LDBL_EXP_DIG 5
87 #ifndef YARP_NO_DEPRECATED // since YARP 3.0.0
96 #define YARP_INT32_FMT PRId32
97 #define YARP_INT64_FMT PRId64
98 #endif // YARP_NO_DEPRECATED