Skip to content

Commit 6f41cff

Browse files
Wilco Dijkstransz-arm
authored andcommitted
math: Improve comments, disable errno handling by default
Improve comments in math_config.h. Set WANT_ERRNO to 0 by default.
1 parent 4fba27c commit 6f41cff

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

math/math_config.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@
1212
#include <stdint.h>
1313

1414
#ifndef WANT_ROUNDING
15-
/* Correct special case results in non-nearest rounding modes. */
15+
/* If defined to 1, return correct results for special cases in non-nearest
16+
rounding modes (logf (1.0f) returns 0.0f with FE_DOWNWARD rather than -0.0f).
17+
This may be set to 0 if there is no fenv support or if math functions only
18+
get called in round to nearest mode. */
1619
# define WANT_ROUNDING 1
1720
#endif
1821
#ifndef WANT_ERRNO
19-
/* Set errno according to ISO C with (math_errhandling & MATH_ERRNO) != 0. */
20-
# define WANT_ERRNO 1
22+
/* If defined to 1, set errno in math functions according to ISO C. Many math
23+
libraries do not set errno, so this is 0 by default. It may need to be
24+
set to 1 if math.h has (math_errhandling & MATH_ERRNO) != 0. */
25+
# define WANT_ERRNO 0
2126
#endif
2227
#ifndef WANT_ERRNO_UFLOW
2328
/* Set errno to ERANGE if result underflows to 0 (in all rounding modes). */

0 commit comments

Comments
 (0)