@@ -34,27 +34,18 @@ template<typename _Tp> inline constexpr
3434__cmath_enable_if_t <__cmath_is_integral_v<_Tp>, bool >
3535signbit (_Tp __x) { return (__x < 0 ); }
3636
37- inline constexpr bool isinf (float __x) {
38- if (__builtin_constant_p (__x)) {
39- return __builtin_isinf (__x);
40- }
41- return _isinff (__x);
37+ inline constexpr bool issignaling (float __x) {
38+ return _issignalingf (__x);
4239}
43- inline constexpr bool isinf (double __x) {
44- if (__builtin_constant_p (__x)) {
45- return __builtin_isinf (__x);
46- }
47- return _isinff (__x);
40+ inline constexpr bool issignaling (double __x) {
41+ return _issignalingf (__x);
4842}
49- inline constexpr bool isinf (long double __x) {
50- if (__builtin_constant_p (__x)) {
51- return __builtin_isinf (__x);
52- }
53- return _isinfl (__x);
43+ inline constexpr bool issignaling (long double __x) {
44+ return _issignalingl (__x);
5445}
5546template <typename _Tp> inline constexpr
5647__cmath_enable_if_t <__cmath_is_integral_v<_Tp>, bool >
57- isinf (_Tp __x) { return false ; }
48+ issignaling (_Tp __x) { return false ; }
5849
5950inline constexpr bool isnan (float __x) {
6051 if (__builtin_constant_p (__x)) {
@@ -78,27 +69,27 @@ template<typename _Tp> inline constexpr
7869__cmath_enable_if_t <__cmath_is_integral_v<_Tp>, bool >
7970isnan (_Tp __x) { return false ; }
8071
81- inline constexpr bool isnormal (float __x) {
72+ inline constexpr bool isinf (float __x) {
8273 if (__builtin_constant_p (__x)) {
83- return __builtin_isnormal (__x);
74+ return __builtin_isinf (__x);
8475 }
85- return _isnormalf (__x);
76+ return _isinff (__x);
8677}
87- inline constexpr bool isnormal (double __x) {
78+ inline constexpr bool isinf (double __x) {
8879 if (__builtin_constant_p (__x)) {
89- return __builtin_isnormal (__x);
80+ return __builtin_isinf (__x);
9081 }
91- return _isnormalf (__x);
82+ return _isinff (__x);
9283}
93- inline constexpr bool isnormal (long double __x) {
84+ inline constexpr bool isinf (long double __x) {
9485 if (__builtin_constant_p (__x)) {
95- return __builtin_isnormal (__x);
86+ return __builtin_isinf (__x);
9687 }
97- return _isnormall (__x);
88+ return _isinfl (__x);
9889}
9990template <typename _Tp> inline constexpr
10091__cmath_enable_if_t <__cmath_is_integral_v<_Tp>, bool >
101- isnormal (_Tp __x) { return (__x != 0 ) ; }
92+ isinf (_Tp __x) { return false ; }
10293
10394inline constexpr bool isfinite (float __x) {
10495 if (__builtin_constant_p (__x)) {
@@ -122,27 +113,27 @@ template<typename _Tp> inline constexpr
122113__cmath_enable_if_t <__cmath_is_integral_v<_Tp>, bool >
123114isfinite (_Tp __x) { return true ; }
124115
125- inline constexpr bool iszero (float __x) {
116+ inline constexpr bool isnormal (float __x) {
126117 if (__builtin_constant_p (__x)) {
127- return (__x == 0 . 0f );
118+ return __builtin_isnormal (__x);
128119 }
129- return _iszerof (__x);
120+ return _isnormalf (__x);
130121}
131- inline constexpr bool iszero (double __x) {
122+ inline constexpr bool isnormal (double __x) {
132123 if (__builtin_constant_p (__x)) {
133- return (__x == 0.0 );
124+ return __builtin_isnormal (__x);
134125 }
135- return _iszerof (__x);
126+ return _isnormalf (__x);
136127}
137- inline constexpr bool iszero (long double __x) {
128+ inline constexpr bool isnormal (long double __x) {
138129 if (__builtin_constant_p (__x)) {
139- return (__x == 0 . 0L );
130+ return __builtin_isnormal (__x);
140131 }
141- return _iszerol (__x);
132+ return _isnormall (__x);
142133}
143134template <typename _Tp> inline constexpr
144135__cmath_enable_if_t <__cmath_is_integral_v<_Tp>, bool >
145- iszero (_Tp __x) { return (__x = = 0 ); }
136+ isnormal (_Tp __x) { return (__x ! = 0 ); }
146137
147138inline constexpr bool issubnormal (float __x) {
148139 if (__builtin_constant_p (__x)) {
@@ -166,6 +157,28 @@ template<typename _Tp> inline constexpr
166157__cmath_enable_if_t <__cmath_is_integral_v<_Tp>, bool >
167158issubnormal (_Tp __x) { return false ; }
168159
160+ inline constexpr bool iszero (float __x) {
161+ if (__builtin_constant_p (__x)) {
162+ return (__x == 0 .0f );
163+ }
164+ return _iszerof (__x);
165+ }
166+ inline constexpr bool iszero (double __x) {
167+ if (__builtin_constant_p (__x)) {
168+ return (__x == 0.0 );
169+ }
170+ return _iszerof (__x);
171+ }
172+ inline constexpr bool iszero (long double __x) {
173+ if (__builtin_constant_p (__x)) {
174+ return (__x == 0 .0L );
175+ }
176+ return _iszerol (__x);
177+ }
178+ template <typename _Tp> inline constexpr
179+ __cmath_enable_if_t <__cmath_is_integral_v<_Tp>, bool >
180+ iszero (_Tp __x) { return (__x == 0 ); }
181+
169182inline constexpr int fpclassify (float __x) {
170183 if (__builtin_constant_p (__x)) {
171184 return __builtin_fpclassify (FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x);
@@ -801,12 +814,13 @@ trunc(_Tp __x) { return trunc(__x); }
801814} // namespace std
802815
803816using std::signbit;
804- using std::isinf ;
817+ using std::issignaling ;
805818using std::isnan;
806- using std::isnormal ;
819+ using std::isinf ;
807820using std::isfinite;
808- using std::iszero ;
821+ using std::isnormal ;
809822using std::issubnormal;
823+ using std::iszero;
810824using std::fpclassify;
811825
812826using std::isgreater;
0 commit comments