about summary refs log tree commit diff
path: root/math/math.h
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2017-09-01 11:19:47 -0400
committerZack Weinberg <zackw@panix.com>2017-09-01 11:19:47 -0400
commita617bd119f1b36a7ff2d2fdecf0d2f56970d0288 (patch)
treeafc91c5ecccb67e03ac2d4b436b5a56a53fc93bd /math/math.h
parentce870587d5055437619680700ee5663a3cec66f6 (diff)
downloadglibc-a617bd119f1b36a7ff2d2fdecf0d2f56970d0288.tar.gz
glibc-a617bd119f1b36a7ff2d2fdecf0d2f56970d0288.tar.xz
glibc-a617bd119f1b36a7ff2d2fdecf0d2f56970d0288.zip
math/math.h (HUGE_VAL): Improve commentary.
Diffstat (limited to 'math/math.h')
-rw-r--r--math/math.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/math/math.h b/math/math.h
index bbc1ab9bfa..547b36d10e 100644
--- a/math/math.h
+++ b/math/math.h
@@ -37,11 +37,16 @@ __BEGIN_DECLS
 /* Gather machine dependent type support.  */
 #include <bits/floatn.h>
 
-/* Value returned on overflow.  On all IEEE754 machines, this is
-   +Infinity.  */
+/* Value returned on overflow.  With IEEE 754 floating point, this is
+   +Infinity, otherwise the largest representable positive value.  */
 #if __GNUC_PREREQ (3, 3)
 # define HUGE_VAL (__builtin_huge_val ())
 #else
+/* This may provoke compiler warnings, and may not be rounded to
+   +Infinity in all IEEE 754 rounding modes, but is the best that can
+   be done in ISO C while remaining a constant expression.  10,000 is
+   greater than the maximum (decimal) exponent for all supported
+   floating-point formats and widths.  */
 # define HUGE_VAL 1e10000
 #endif
 #ifdef __USE_ISOC99