Namespaces
Variants
Views
Actions

HUGE_VALF

From cppreference.com
< c‎ | numeric‎ | math
 
 
 
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)(C99)(C99)
Exponential functions
(C99)
(C99)
(C99)
(C99)
Power functions
(C99)
(C99)
Trigonometric and hyperbolic functions
(C99)
(C99)
(C99)
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Nearest integer floating point operations
(C99)(C99)(C99)
(C99)
(C99)(C99)(C99)
Floating point manipulation functions
(C99)(C99)
(C99)
(C99)
Classification
(C99)
(C99)
(C99)
Macro constants
HUGE_VALFHUGE_VALHUGE_VALL
(C99)(C99)
 
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 expands to a positive floating point constant expression.

Constant Explanation
HUGE_VALF Indicates that the value is not representable by the float type (infinity)
HUGE_VAL Indicates that the value is not representable by the double type (infinity).
The constant is not necessarily representable as a float
HUGE_VALL Indicates that the value is not representable by the long double type (infinity).
The constant is not necessarily representable as a float or double

[edit] Example

#include <stdio.h>
#include <math.h>
#include <float.h>
 
int main()
{
    printf("HUGE_VALF = %f\n",  HUGE_VALF);
    printf("HUGE_VAL  = %f\n",  HUGE_VAL);
    printf("HUGE_VALL = %Lf\n", HUGE_VALL);
 
    return 0;
}

Possible output:

HUGE_VALF = inf
HUGE_VAL  = inf
HUGE_VALL = inf

[edit] See also

C++ documentation for HUGE_VAL