Namespaces
Variants
Views
Actions

HUGE_VALF, HUGE_VAL, HUGE_VALL

From cppreference.com
< cpp‎ | numeric‎ | math
 
 
 
Common mathematical functions
Functions
Basic operations
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Exponential functions
(C++11)
(C++11)
(C++11)
(C++11)
Power functions
(C++11)
(C++11)
Trigonometric and hyperbolic functions
(C++11)
(C++11)
(C++11)
Error and gamma functions
(C++11)
(C++11)
(C++11)
(C++11)
Nearest integer floating point operations
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Floating point manipulation functions
(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)
Classification/Comparison
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Macro constants
HUGE_VALFHUGE_VALHUGE_VALL
(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)(C++11)(C++11)
 
Defined in header <cmath>
#define HUGE_VALF /*implementation defined*/
(since C++11)
#define HUGE_VAL  /*implementation defined*/
#define HUGE_VALL /*implementation defined*/
(since C++11)

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.

[edit] See also

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