A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://en.cppreference.com/w/c/numeric/math/HUGE_VAL.html below:

HUGE_VALF, HUGE_VAL, HUGE_VALL - cppreference.com

#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
#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
[edit] References
[edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4