Classes | Namespaces | Macros
mathlimits.h File Reference
#include <math.h>
#include <string.h>
#include <cfloat>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/port_def.inc>
#include <google/protobuf/port_undef.inc>
Include dependency graph for mathlimits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  google::protobuf::MathLimits< T >
 

Namespaces

 google
 
 google::protobuf
 

Macros

#define DECL_FP_LIMIT_FUNCS
 
#define DECL_FP_LIMITS(FP_Type, PREFIX)
 
#define DECL_INT_LIMIT_FUNCS
 
#define DECL_SIGNED_INT_LIMITS(IntType, UnsignedIntType)
 
#define DECL_UNSIGNED_INT_LIMITS(IntType)
 
#define ISINF   isinf
 
#define ISNAN   isnan
 
#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 SIGNED_MAX_10_EXP(Type)
 
#define UNSIGNED_INT_MAX(Type)   (((Type(1) << (sizeof(Type)*8 - 1)) - 1) + (Type(1) << (sizeof(Type)*8 - 1)))
 
#define UNSIGNED_MAX_10_EXP(Type)
 

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; }

Definition at line 256 of file mathlimits.h.

◆ DECL_FP_LIMITS

#define DECL_FP_LIMITS (   FP_Type,
  PREFIX 
)
Value:
template <> \
struct PROTOBUF_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 at line 268 of file mathlimits.h.

◆ 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; }

Definition at line 171 of file mathlimits.h.

◆ DECL_SIGNED_INT_LIMITS

#define DECL_SIGNED_INT_LIMITS (   IntType,
  UnsignedIntType 
)
Value:
template <> \
struct PROTOBUF_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 \
};

Definition at line 178 of file mathlimits.h.

◆ DECL_UNSIGNED_INT_LIMITS

#define DECL_UNSIGNED_INT_LIMITS (   IntType)
Value:
template <> \
struct PROTOBUF_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 \
};

Definition at line 198 of file mathlimits.h.

◆ ISINF

#define ISINF   isinf

Definition at line 243 of file mathlimits.h.

◆ ISNAN

#define ISNAN   isnan

Definition at line 244 of file mathlimits.h.

◆ SIGNED_INT_MAX

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

Definition at line 149 of file mathlimits.h.

◆ SIGNED_INT_MIN

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

Definition at line 152 of file mathlimits.h.

◆ 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))))

Definition at line 159 of file mathlimits.h.

◆ UNSIGNED_INT_MAX

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

Definition at line 155 of file mathlimits.h.

◆ 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))))

Definition at line 165 of file mathlimits.h.

Type
struct Type Type
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:673
ISINF
#define ISINF
Definition: mathlimits.h:243
ISNAN
#define ISNAN
Definition: mathlimits.h:244
UNSIGNED_INT_MAX
#define UNSIGNED_INT_MAX(Type)
Definition: mathlimits.h:155
SIGNED_INT_MIN
#define SIGNED_INT_MIN(Type)
Definition: mathlimits.h:152
tests.google.protobuf.internal.message_test.IsPosInf
def IsPosInf(val)
Definition: bloaty/third_party/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py:71
UNSIGNED_MAX_10_EXP
#define UNSIGNED_MAX_10_EXP(Type)
Definition: mathlimits.h:165
Type
Definition: bloaty/third_party/protobuf/src/google/protobuf/type.pb.h:182
tests.google.protobuf.internal.message_test.IsNegInf
def IsNegInf(val)
Definition: bloaty/third_party/protobuf/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py:73
x
int x
Definition: bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3610
SIGNED_INT_MAX
#define SIGNED_INT_MAX(Type)
Definition: mathlimits.h:149
SIGNED_MAX_10_EXP
#define SIGNED_MAX_10_EXP(Type)
Definition: mathlimits.h:159
absl::ABSL_NAMESPACE_BEGIN::IsFinite
bool IsFinite(double d)
Definition: abseil-cpp/absl/time/duration.cc:88
PREFIX
#define PREFIX
Definition: bloaty/third_party/protobuf/benchmarks/cpp/cpp_benchmark.cc:42


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:23