webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Namespaces | Macros
mathlimits.h File Reference
#include <math.h>
#include <string.h>
#include <cfloat>
#include <google/protobuf/stubs/common.h>

Go to the source code of this file.

Classes

struct  google::protobuf::MathLimits< T >
 

Namespaces

 google
 
 google::protobuf
 

Macros

#define SIGNED_INT_MAX(Type)   (((Type(1) << (sizeof(Type)*8 - 2)) - 1) + (Type(1) << (sizeof(Type)*8 - 2)))
 
#define SIGNED_INT_MIN(Type)   (-(Type(1) << (sizeof(Type)*8 - 2)) - (Type(1) << (sizeof(Type)*8 - 2)))
 
#define UNSIGNED_INT_MAX(Type)   (((Type(1) << (sizeof(Type)*8 - 1)) - 1) + (Type(1) << (sizeof(Type)*8 - 1)))
 
#define SIGNED_MAX_10_EXP(Type)
 
#define UNSIGNED_MAX_10_EXP(Type)
 
#define DECL_INT_LIMIT_FUNCS
 
#define DECL_SIGNED_INT_LIMITS(IntType, UnsignedIntType)
 
#define DECL_UNSIGNED_INT_LIMITS(IntType)
 
#define DECL_FP_LIMIT_FUNCS
 
#define DECL_FP_LIMITS(FP_Type, PREFIX)
 

Macro Definition Documentation

◆ DECL_FP_LIMIT_FUNCS

#define DECL_FP_LIMIT_FUNCS
Value:
static bool IsFinite(const Type x) { return !isinf(x) && !isnan(x); } \
static bool IsNaN(const Type x) { return isnan(x); } \
static bool IsInf(const Type x) { return isinf(x); } \
static bool IsPosInf(const Type x) { return isinf(x) && x > 0; } \
static bool IsNegInf(const Type x) { return isinf(x) && x < 0; }
def isinf(val)
Definition: message_test.py:82
def isnan(val)
Definition: message_test.py:79
EGLSurface EGLint x
Definition: eglext.h:950
def IsPosInf(val)
Definition: message_test.py:85
Type
Type of JSON value.
Definition: rapidjson.h:616
def IsNegInf(val)
Definition: message_test.py:87

◆ DECL_FP_LIMITS

#define DECL_FP_LIMITS (   FP_Type,
  PREFIX 
)
Value:
template<> \
struct LIBPROTOBUF_EXPORT MathLimits<FP_Type> { \
typedef FP_Type Type; \
typedef FP_Type UnsignedType; \
static const bool kIsSigned = true; \
static const bool kIsInteger = false; \
static const Type kPosMin; \
static const Type kPosMax; \
static const Type kMin; \
static const Type kMax; \
static const Type kNegMin; \
static const Type kNegMax; \
static const int kMin10Exp = PREFIX##_MIN_10_EXP; \
static const int kMax10Exp = PREFIX##_MAX_10_EXP; \
static const Type kEpsilon; \
static const Type kStdError; \
static const int kPrecisionDigits = PREFIX##_DIG; \
static const Type kNaN; \
static const Type kPosInf; \
static const Type kNegInf; \
DECL_FP_LIMIT_FUNCS \
};
Definition: xmlparse.c:154
#define LIBPROTOBUF_EXPORT
Definition: port.h:97
Type
Type of JSON value.
Definition: rapidjson.h:616

◆ DECL_INT_LIMIT_FUNCS

#define DECL_INT_LIMIT_FUNCS
Value:
static bool IsFinite(const Type /*x*/) { return true; } \
static bool IsNaN(const Type /*x*/) { return false; } \
static bool IsInf(const Type /*x*/) { return false; } \
static bool IsPosInf(const Type /*x*/) { return false; } \
static bool IsNegInf(const Type /*x*/) { return false; }
def IsPosInf(val)
Definition: message_test.py:85
Type
Type of JSON value.
Definition: rapidjson.h:616
def IsNegInf(val)
Definition: message_test.py:87

◆ DECL_SIGNED_INT_LIMITS

#define DECL_SIGNED_INT_LIMITS (   IntType,
  UnsignedIntType 
)
Value:
template<> \
struct LIBPROTOBUF_EXPORT MathLimits<IntType> { \
typedef IntType Type; \
typedef UnsignedIntType UnsignedType; \
static const bool kIsSigned = true; \
static const bool kIsInteger = true; \
static const Type kPosMin = 1; \
static const Type kPosMax = SIGNED_INT_MAX(Type); \
static const Type kMin = SIGNED_INT_MIN(Type); \
static const Type kMax = kPosMax; \
static const Type kNegMin = -1; \
static const Type kNegMax = kMin; \
static const int kMin10Exp = 0; \
static const int kMax10Exp = SIGNED_MAX_10_EXP(Type); \
static const Type kEpsilon = 1; \
static const Type kStdError = 0; \
DECL_INT_LIMIT_FUNCS \
};
#define SIGNED_INT_MAX(Type)
Definition: mathlimits.h:136
#define SIGNED_MAX_10_EXP(Type)
Definition: mathlimits.h:146
#define SIGNED_INT_MIN(Type)
Definition: mathlimits.h:139
#define LIBPROTOBUF_EXPORT
Definition: port.h:97
Type
Type of JSON value.
Definition: rapidjson.h:616

◆ DECL_UNSIGNED_INT_LIMITS

#define DECL_UNSIGNED_INT_LIMITS (   IntType)
Value:
template<> \
struct LIBPROTOBUF_EXPORT MathLimits<IntType> { \
typedef IntType Type; \
typedef IntType UnsignedType; \
static const bool kIsSigned = false; \
static const bool kIsInteger = true; \
static const Type kPosMin = 1; \
static const Type kPosMax = UNSIGNED_INT_MAX(Type); \
static const Type kMin = 0; \
static const Type kMax = kPosMax; \
static const int kMin10Exp = 0; \
static const int kMax10Exp = UNSIGNED_MAX_10_EXP(Type); \
static const Type kEpsilon = 1; \
static const Type kStdError = 0; \
DECL_INT_LIMIT_FUNCS \
};
#define UNSIGNED_MAX_10_EXP(Type)
Definition: mathlimits.h:152
#define UNSIGNED_INT_MAX(Type)
Definition: mathlimits.h:142
#define LIBPROTOBUF_EXPORT
Definition: port.h:97
Type
Type of JSON value.
Definition: rapidjson.h:616

◆ SIGNED_INT_MAX

#define SIGNED_INT_MAX (   Type)    (((Type(1) << (sizeof(Type)*8 - 2)) - 1) + (Type(1) << (sizeof(Type)*8 - 2)))

◆ SIGNED_INT_MIN

#define SIGNED_INT_MIN (   Type)    (-(Type(1) << (sizeof(Type)*8 - 2)) - (Type(1) << (sizeof(Type)*8 - 2)))

◆ SIGNED_MAX_10_EXP

#define SIGNED_MAX_10_EXP (   Type)
Value:
(sizeof(Type) == 1 ? 2 : ( \
sizeof(Type) == 2 ? 4 : ( \
sizeof(Type) == 4 ? 9 : ( \
sizeof(Type) == 8 ? 18 : -1))))
Type
Type of JSON value.
Definition: rapidjson.h:616

◆ UNSIGNED_INT_MAX

#define UNSIGNED_INT_MAX (   Type)    (((Type(1) << (sizeof(Type)*8 - 1)) - 1) + (Type(1) << (sizeof(Type)*8 - 1)))

◆ UNSIGNED_MAX_10_EXP

#define UNSIGNED_MAX_10_EXP (   Type)
Value:
(sizeof(Type) == 1 ? 2 : ( \
sizeof(Type) == 2 ? 4 : ( \
sizeof(Type) == 4 ? 9 : ( \
sizeof(Type) == 8 ? 19 : -1))))
Type
Type of JSON value.
Definition: rapidjson.h:616