From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/numeric%2Fmath%2Fhuge_val.html | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 devdocs/c/numeric%2Fmath%2Fhuge_val.html (limited to 'devdocs/c/numeric%2Fmath%2Fhuge_val.html') diff --git a/devdocs/c/numeric%2Fmath%2Fhuge_val.html b/devdocs/c/numeric%2Fmath%2Fhuge_val.html new file mode 100644 index 00000000..d95e528b --- /dev/null +++ b/devdocs/c/numeric%2Fmath%2Fhuge_val.html @@ -0,0 +1,52 @@ +

HUGE_VALF, HUGE_VAL, HUGE_VALL

Defined in header <math.h>
#define HUGE_VALF /*implementation defined*/
+
(since C99)
#define HUGE_VAL  /*implementation defined*/
+
#define HUGE_VALL /*implementation defined*/
+
(since C99)

The HUGE_VALF, HUGE_VAL and HUGE_VALL macros expand to positive floating point constant expressions which compare equal to the values returned by floating-point functions and operators in case of overflow (see math_errhandling).

+ + + + +
Constant Explanation
HUGE_VALF Expands to positive float expression that indicates overflow
HUGE_VAL Expands to positive double expression that indicates overflow, not necessarily representable as a float
HUGE_VALL Expands to positive long double expression that indicates overflow, not necessarily representable as a float or double

On implementations that support floating-point infinities, these macros always expand to the positive infinities of float, double, and long double, respectively.

+

Example

#include <math.h>
+#include <stdio.h>
+ 
+int main(void)
+{
+    const double result = 1.0 / 0.0;
+    printf("1.0/0.0 == %f\n", result);
+    if (result == HUGE_VAL)
+        puts("1.0/0.0 == HUGE_VAL");
+}

Possible output:

+
1.0/0.0 == inf
+1.0/0.0 == HUGE_VAL

References

See also

+ +
+
(C99)
evaluates to positive infinity or the value guaranteed to overflow a float
(macro constant)
C++ documentation for HUGE_VAL
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/numeric/math/HUGE_VAL +

+
-- cgit v1.2.3