30 #ifndef GOOGLE_PROTOBUF_STUBS_MATHUTIL_H_ 31 #define GOOGLE_PROTOBUF_STUBS_MATHUTIL_H_ 70 return fabs(a - b) < 32 * FLT_EPSILON;
75 return fabs(a - b) < 32 * DBL_EPSILON;
83 if (value ==
T(0) || ::google::protobuf::internal::IsNan<T>(value)) {
86 return value >
T(0) ? 1 : -1;
112 return x >
T(0) ?
x : -
x;
121 return x > y ?
R(x) -
R(y) :
R(y) -
R(x);
131 static bool WithinFractionOrMargin(
const T x,
const T y,
132 const T fraction,
const T margin);
137 const T fraction,
const T margin) {
154 T relative_margin =
static_cast<T>(fraction * Max(Abs(x), Abs(y)));
155 return AbsDiff(x, y) <= Max(margin, relative_margin);
162 #endif // GOOGLE_PROTOBUF_STUBS_MATHUTIL_H_ Definition: mathutil.h:79
static T Max(const T x, const T y)
Definition: mathutil.h:101
def isnan(val)
Definition: message_test.py:79
T UnsignedType
Definition: mathlimits.h:70
const FieldDescriptor const OneofDescriptor value
Definition: descriptor.h:1717
static MathLimits< T >::UnsignedType AbsDiff(const T x, const T y)
Definition: mathutil.h:118
TestSubObjConstructor T
Definition: TestTypedefs.idl:84
EGLSurface EGLint x
Definition: eglext.h:950
static bool IsNaN(const Type x)
EGLAttrib * value
Definition: eglext.h:120
static bool AlmostEquals(T a, T b)
Definition: mathutil.h:90
static bool WithinFractionOrMargin(const T x, const T y, const T fraction, const T margin)
Definition: mathutil.h:136
static T Abs(const T x)
Definition: mathutil.h:111
Definition: __init__.py:1
Definition: mathlimits.h:65
EGLSurface EGLint EGLint y
Definition: eglext.h:950
static T Sign(T value)
Definition: mathutil.h:82
GLboolean GLboolean GLboolean GLboolean a
Definition: gl2ext.h:306
bool AlmostEquals(double a, double b)
Definition: mathutil.h:74
Definition: document.h:393
bool AlmostEquals(T a, T b)
Definition: mathutil.h:65
#define GOOGLE_DCHECK
Definition: logging.h:192
bool IsNan(T value)
Definition: mathutil.h:44
GLboolean GLboolean GLboolean b
Definition: gl2ext.h:306
Definition: gflags_completions.h:115
#define R(x)
Definition: mangle.cgi.c:21
#define T(a)
Definition: row_common.cc:1964