HUGE_VALF - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# HUGE_VALF

From cppreference.com
< c‎ | numeric‎ | math

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.

### [edit] Example

| This section is incomplete Reason: example showing how to use this

Run this code

    #include <stdio.h>
    #include <math.h>

    int main(void)
    {
        printf("HUGE_VALF = %f\n",  HUGE_VALF);
        printf("HUGE_VAL  = %f\n",  HUGE_VAL);
        printf("HUGE_VALL = %Lf\n", HUGE_VALL);
    }

Possible output:

    HUGE_VALF = inf
    HUGE_VAL  = inf
    HUGE_VALL = inf

### [edit] See also

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

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/numeric/math/HUGE_VAL&oldid=70466"
Category:

- Todo with reason