Skip to content

Commit 98fb0d0

Browse files
committed
Wrap static rounding expf function with #pragma STDC FENV_ACCESS ON
1 parent c56b965 commit 98fb0d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libc/src/__support/math/expf.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ static constexpr float expf(float x) {
109109
return static_cast<float>(exp_hi * exp_mid * exp_lo);
110110
}
111111

112+
#pragma STDC FENV_ACCESS ON
113+
112114
// Directional rounding version of expf.
113115
LIBC_INLINE static float expf(float x, int rounding_mode) {
114116
int current_rounding_mode = fputil::get_round();
@@ -121,6 +123,8 @@ LIBC_INLINE static float expf(float x, int rounding_mode) {
121123
return result;
122124
}
123125

126+
#pragma STDC FENV_ACCESS DEFAULT
127+
124128
} // namespace math
125129

126130
} // namespace LIBC_NAMESPACE_DECL

0 commit comments

Comments
 (0)