Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions include/cmath
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,49 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#undef islessgreater
#undef isunordered

#if !defined(FP_NAN)
#define FP_NAN 0
#endif
#if !defined(FP_INFINITE)
#define FP_INFINITE 1
#endif
#if !defined(FP_ZERO)
#define FP_ZERO 2
#endif
#if !defined(FP_SUBNORMAL)
#define FP_SUBNORMAL 3
#endif
#if !defined(FP_NORMAL)
#define FP_NORMAL 4
#endif

#if __cplusplus >= 201103L

#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr int
fpclassify(float __x)
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
FP_SUBNORMAL, FP_ZERO, __x); }

constexpr int
fpclassify(double __x)
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
FP_SUBNORMAL, FP_ZERO, __x); }

constexpr int
fpclassify(long double __x)
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
FP_SUBNORMAL, FP_ZERO, __x); }
#endif

#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
int>::__type
fpclassify(_Tp __x)
{ return __x != 0 ? FP_NORMAL : FP_ZERO; }
#endif

#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
constexpr bool
isfinite(float __x)
Expand Down
Loading