@@ -26,139 +26,155 @@ namespace __math {
2626
2727// exp
2828
29- inline _LIBCPP_HIDE_FROM_ABI float exp (float __x) _NOEXCEPT { return __builtin_expf (__x); }
29+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float exp (float __x) _NOEXCEPT { return __builtin_expf (__x); }
3030
3131template <class = int >
32- _LIBCPP_HIDE_FROM_ABI double exp (double __x) _NOEXCEPT {
32+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double exp (double __x) _NOEXCEPT {
3333 return __builtin_exp (__x);
3434}
3535
36- inline _LIBCPP_HIDE_FROM_ABI long double exp (long double __x) _NOEXCEPT { return __builtin_expl (__x); }
36+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double exp (long double __x) _NOEXCEPT {
37+ return __builtin_expl (__x);
38+ }
3739
3840template <class _A1 , __enable_if_t <is_integral<_A1>::value, int > = 0 >
39- inline _LIBCPP_HIDE_FROM_ABI double exp (_A1 __x) _NOEXCEPT {
41+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI double exp (_A1 __x) _NOEXCEPT {
4042 return __builtin_exp ((double )__x);
4143}
4244
4345// frexp
4446
45- inline _LIBCPP_HIDE_FROM_ABI float frexp (float __x, int * __e) _NOEXCEPT { return __builtin_frexpf (__x, __e); }
47+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float frexp (float __x, int * __e) _NOEXCEPT {
48+ return __builtin_frexpf (__x, __e);
49+ }
4650
4751template <class = int >
48- _LIBCPP_HIDE_FROM_ABI double frexp (double __x, int * __e) _NOEXCEPT {
52+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double frexp (double __x, int * __e) _NOEXCEPT {
4953 return __builtin_frexp (__x, __e);
5054}
5155
52- inline _LIBCPP_HIDE_FROM_ABI long double frexp (long double __x, int * __e) _NOEXCEPT {
56+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double frexp (long double __x, int * __e) _NOEXCEPT {
5357 return __builtin_frexpl (__x, __e);
5458}
5559
5660template <class _A1 , __enable_if_t <is_integral<_A1>::value, int > = 0 >
57- inline _LIBCPP_HIDE_FROM_ABI double frexp (_A1 __x, int * __e) _NOEXCEPT {
61+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI double frexp (_A1 __x, int * __e) _NOEXCEPT {
5862 return __builtin_frexp ((double )__x, __e);
5963}
6064
6165// ldexp
6266
63- inline _LIBCPP_HIDE_FROM_ABI float ldexp (float __x, int __e) _NOEXCEPT { return __builtin_ldexpf (__x, __e); }
67+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float ldexp (float __x, int __e) _NOEXCEPT {
68+ return __builtin_ldexpf (__x, __e);
69+ }
6470
6571template <class = int >
66- _LIBCPP_HIDE_FROM_ABI double ldexp (double __x, int __e) _NOEXCEPT {
72+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double ldexp (double __x, int __e) _NOEXCEPT {
6773 return __builtin_ldexp (__x, __e);
6874}
6975
70- inline _LIBCPP_HIDE_FROM_ABI long double ldexp (long double __x, int __e) _NOEXCEPT {
76+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double ldexp (long double __x, int __e) _NOEXCEPT {
7177 return __builtin_ldexpl (__x, __e);
7278}
7379
7480template <class _A1 , __enable_if_t <is_integral<_A1>::value, int > = 0 >
75- inline _LIBCPP_HIDE_FROM_ABI double ldexp (_A1 __x, int __e) _NOEXCEPT {
81+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI double ldexp (_A1 __x, int __e) _NOEXCEPT {
7682 return __builtin_ldexp ((double )__x, __e);
7783}
7884
7985// exp2
8086
81- inline _LIBCPP_HIDE_FROM_ABI float exp2 (float __x) _NOEXCEPT { return __builtin_exp2f (__x); }
87+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float exp2 (float __x) _NOEXCEPT { return __builtin_exp2f (__x); }
8288
8389template <class = int >
84- _LIBCPP_HIDE_FROM_ABI double exp2 (double __x) _NOEXCEPT {
90+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double exp2 (double __x) _NOEXCEPT {
8591 return __builtin_exp2 (__x);
8692}
8793
88- inline _LIBCPP_HIDE_FROM_ABI long double exp2 (long double __x) _NOEXCEPT { return __builtin_exp2l (__x); }
94+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double exp2 (long double __x) _NOEXCEPT {
95+ return __builtin_exp2l (__x);
96+ }
8997
9098template <class _A1 , __enable_if_t <is_integral<_A1>::value, int > = 0 >
91- inline _LIBCPP_HIDE_FROM_ABI double exp2 (_A1 __x) _NOEXCEPT {
99+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI double exp2 (_A1 __x) _NOEXCEPT {
92100 return __builtin_exp2 ((double )__x);
93101}
94102
95103// expm1
96104
97- inline _LIBCPP_HIDE_FROM_ABI float expm1 (float __x) _NOEXCEPT { return __builtin_expm1f (__x); }
105+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float expm1 (float __x) _NOEXCEPT { return __builtin_expm1f (__x); }
98106
99107template <class = int >
100- _LIBCPP_HIDE_FROM_ABI double expm1 (double __x) _NOEXCEPT {
108+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double expm1 (double __x) _NOEXCEPT {
101109 return __builtin_expm1 (__x);
102110}
103111
104- inline _LIBCPP_HIDE_FROM_ABI long double expm1 (long double __x) _NOEXCEPT { return __builtin_expm1l (__x); }
112+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double expm1 (long double __x) _NOEXCEPT {
113+ return __builtin_expm1l (__x);
114+ }
105115
106116template <class _A1 , __enable_if_t <is_integral<_A1>::value, int > = 0 >
107- inline _LIBCPP_HIDE_FROM_ABI double expm1 (_A1 __x) _NOEXCEPT {
117+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI double expm1 (_A1 __x) _NOEXCEPT {
108118 return __builtin_expm1 ((double )__x);
109119}
110120
111121// scalbln
112122
113- inline _LIBCPP_HIDE_FROM_ABI float scalbln (float __x, long __y) _NOEXCEPT { return __builtin_scalblnf (__x, __y); }
123+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float scalbln (float __x, long __y) _NOEXCEPT {
124+ return __builtin_scalblnf (__x, __y);
125+ }
114126
115127template <class = int >
116- _LIBCPP_HIDE_FROM_ABI double scalbln (double __x, long __y) _NOEXCEPT {
128+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double scalbln (double __x, long __y) _NOEXCEPT {
117129 return __builtin_scalbln (__x, __y);
118130}
119131
120- inline _LIBCPP_HIDE_FROM_ABI long double scalbln (long double __x, long __y) _NOEXCEPT {
132+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double scalbln (long double __x, long __y) _NOEXCEPT {
121133 return __builtin_scalblnl (__x, __y);
122134}
123135
124136template <class _A1 , __enable_if_t <is_integral<_A1>::value, int > = 0 >
125- inline _LIBCPP_HIDE_FROM_ABI double scalbln (_A1 __x, long __y) _NOEXCEPT {
137+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI double scalbln (_A1 __x, long __y) _NOEXCEPT {
126138 return __builtin_scalbln ((double )__x, __y);
127139}
128140
129141// scalbn
130142
131- inline _LIBCPP_HIDE_FROM_ABI float scalbn (float __x, int __y) _NOEXCEPT { return __builtin_scalbnf (__x, __y); }
143+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float scalbn (float __x, int __y) _NOEXCEPT {
144+ return __builtin_scalbnf (__x, __y);
145+ }
132146
133147template <class = int >
134- _LIBCPP_HIDE_FROM_ABI double scalbn (double __x, int __y) _NOEXCEPT {
148+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double scalbn (double __x, int __y) _NOEXCEPT {
135149 return __builtin_scalbn (__x, __y);
136150}
137151
138- inline _LIBCPP_HIDE_FROM_ABI long double scalbn (long double __x, int __y) _NOEXCEPT {
152+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double scalbn (long double __x, int __y) _NOEXCEPT {
139153 return __builtin_scalbnl (__x, __y);
140154}
141155
142156template <class _A1 , __enable_if_t <is_integral<_A1>::value, int > = 0 >
143- inline _LIBCPP_HIDE_FROM_ABI double scalbn (_A1 __x, int __y) _NOEXCEPT {
157+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI double scalbn (_A1 __x, int __y) _NOEXCEPT {
144158 return __builtin_scalbn ((double )__x, __y);
145159}
146160
147161// pow
148162
149- inline _LIBCPP_HIDE_FROM_ABI float pow (float __x, float __y) _NOEXCEPT { return __builtin_powf (__x, __y); }
163+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI float pow (float __x, float __y) _NOEXCEPT {
164+ return __builtin_powf (__x, __y);
165+ }
150166
151167template <class = int >
152- _LIBCPP_HIDE_FROM_ABI double pow (double __x, double __y) _NOEXCEPT {
168+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double pow (double __x, double __y) _NOEXCEPT {
153169 return __builtin_pow (__x, __y);
154170}
155171
156- inline _LIBCPP_HIDE_FROM_ABI long double pow (long double __x, long double __y) _NOEXCEPT {
172+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI long double pow (long double __x, long double __y) _NOEXCEPT {
157173 return __builtin_powl (__x, __y);
158174}
159175
160176template <class _A1 , class _A2 , __enable_if_t <is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int > = 0 >
161- inline _LIBCPP_HIDE_FROM_ABI __promote_t <_A1, _A2> pow (_A1 __x, _A2 __y) _NOEXCEPT {
177+ [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI __promote_t <_A1, _A2> pow (_A1 __x, _A2 __y) _NOEXCEPT {
162178 using __result_type = __promote_t <_A1, _A2>;
163179 static_assert (!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), " " );
164180 return __math::pow ((__result_type)__x, (__result_type)__y);
0 commit comments