YARP
Yet Another Robot Platform
numeric.h File Reference
#include <sys/types.h>
#include <cfloat>
#include <cinttypes>
#include <clocale>
#include <cstdint>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <limits>
#include <sstream>
#include <string>
#include <yarp/conf/api.h>
+ Include dependency graph for numeric.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 yarp
 The main, catch-all namespace for YARP.
 
 yarp::conf
 
 yarp::conf::numeric
 

Macros

#define YARP_HAS_SYS_TYPES_H
 
#define YARP_LITTLE_ENDIAN
 
#define YARP_HAS_FLOAT128_T
 
#define YARP_FLOAT32_IS_IEC559   1
 
#define YARP_FLOAT64_IS_IEC559   1
 
#define YARP_FLOAT128_IS_IEC559   1
 
#define YARP_FLT_EXP_DIG   3
 
#define YARP_DBL_EXP_DIG   4
 
#define YARP_LDBL_EXP_DIG   5
 
#define YARP_DOUBLE_TO_STRING_MAX_LENGTH   (16 + DECIMAL_DIG + YARP_LDBL_EXP_DIG)
 
#define YARP_INT32_FMT   PRId32
 
#define YARP_INT64_FMT   PRId64
 

Typedefs

typedef float yarp::conf::float32_t
 
typedef double yarp::conf::float64_t
 
typedef std::int32_t yarp::conf::vocab32_t
 
typedef long double yarp::conf::float128_t
 
typedef ::ssize_t yarp::conf::ssize_t
 
typedef std::int8_t YARP_INT8
 
typedef std::int16_t YARP_INT16
 
typedef std::int32_t YARP_INT32
 
typedef std::int64_t YARP_INT64
 
typedef yarp::conf::float32_t YARP_FLOAT32
 
typedef yarp::conf::float64_t YARP_FLOAT64
 
typedef yarp::conf::ssize_t YARP_SSIZE_T
 

Functions

template<class T >
constexpr const T & yarp::conf::clamp (const T &v, const T &lo, const T &hi)
 
template<class T , class Compare >
constexpr const T & yarp::conf::clamp (const T &v, const T &lo, const T &hi, Compare comp)
 
template<typename Integer , std::enable_if_t< std::is_integral< Integer >::value &&!std::is_same< Integer, bool >::value, bool > = true>
std::string yarp::conf::numeric::to_string (Integer x)
 
template<typename Bool , std::enable_if_t< std::is_same< Bool, bool >::value, bool > = true>
std::string yarp::conf::numeric::to_string (Bool x)
 
template<typename Floating , std::enable_if_t< std::is_floating_point< Floating >::value, bool > = true>
std::string yarp::conf::numeric::to_string (Floating x)
 
template<typename Integer , std::enable_if_t< std::is_integral< Integer >::value &&std::is_signed< Integer >::value &&!std::is_same< Integer, bool >::value, bool > = true>
Integer yarp::conf::numeric::from_string (const std::string &src, Integer defaultValue=static_cast< Integer >(0))
 
template<typename Bool , std::enable_if_t< std::is_same< Bool, bool >::value, bool > = true>
Bool yarp::conf::numeric::from_string (const std::string &src, Bool defaultValue=false)
 
template<typename Floating , std::enable_if_t< std::is_floating_point< Floating >::value, bool > = true>
Floating yarp::conf::numeric::from_string (const std::string &src, Floating defaultValue=static_cast< Floating >(0.0))
 
template<typename Integer , std::enable_if_t< std::is_integral< Integer >::value &&sizeof(Integer) !=1 &&!std::is_same< Integer, bool >::value, bool > = true>
std::string yarp::conf::numeric::to_hex_string (Integer i)
 

Macro Definition Documentation

◆ YARP_DBL_EXP_DIG

#define YARP_DBL_EXP_DIG   4

Definition at line 54 of file numeric.h.

◆ YARP_DOUBLE_TO_STRING_MAX_LENGTH

#define YARP_DOUBLE_TO_STRING_MAX_LENGTH   (16 + DECIMAL_DIG + YARP_LDBL_EXP_DIG)

Definition at line 71 of file numeric.h.

◆ YARP_FLOAT128_IS_IEC559

#define YARP_FLOAT128_IS_IEC559   1

Definition at line 38 of file numeric.h.

◆ YARP_FLOAT32_IS_IEC559

#define YARP_FLOAT32_IS_IEC559   1

Definition at line 36 of file numeric.h.

◆ YARP_FLOAT64_IS_IEC559

#define YARP_FLOAT64_IS_IEC559   1

Definition at line 37 of file numeric.h.

◆ YARP_FLT_EXP_DIG

#define YARP_FLT_EXP_DIG   3

Definition at line 53 of file numeric.h.

◆ YARP_HAS_FLOAT128_T

#define YARP_HAS_FLOAT128_T

Definition at line 35 of file numeric.h.

◆ YARP_HAS_SYS_TYPES_H

#define YARP_HAS_SYS_TYPES_H

Definition at line 12 of file numeric.h.

◆ YARP_INT32_FMT

#define YARP_INT32_FMT   PRId32

Definition at line 357 of file numeric.h.

◆ YARP_INT64_FMT

#define YARP_INT64_FMT   PRId64

Definition at line 358 of file numeric.h.

◆ YARP_LDBL_EXP_DIG

#define YARP_LDBL_EXP_DIG   5

Definition at line 55 of file numeric.h.

◆ YARP_LITTLE_ENDIAN

#define YARP_LITTLE_ENDIAN

Definition at line 33 of file numeric.h.

Typedef Documentation

◆ YARP_FLOAT32

Definition at line 354 of file numeric.h.

◆ YARP_FLOAT64

Definition at line 355 of file numeric.h.

◆ YARP_INT16

typedef std::int16_t YARP_INT16

Definition at line 351 of file numeric.h.

◆ YARP_INT32

typedef std::int32_t YARP_INT32

Definition at line 352 of file numeric.h.

◆ YARP_INT64

typedef std::int64_t YARP_INT64

Definition at line 353 of file numeric.h.

◆ YARP_INT8

typedef std::int8_t YARP_INT8

Definition at line 350 of file numeric.h.

◆ YARP_SSIZE_T

Definition at line 356 of file numeric.h.