Type DBL_MAX

I saw this code somewhere

printf("DBL_MAX     :   %g\n", (double) DBL_MAX);

Is a roll required? I can not find anything in the standard that indicates what DBL_MAXshould have a type (or advertise) double.

+4
source share
2 answers

DBL_MAX is indicated as a macro, therefore, it does not have a type by itself.

1999 C , DBL_MAX , 1E+37, . , a double, , , double - (, ).

, , DBL_MAX double. long double ( , a long double , a double).

, DBL_MAX , double, , , . , . printf("DBL_MAX : %g\n", (double) DBL_MAX) ( , , ), , double printf().

+4

, , DBL_MAX double.

N1570 5.2.4.2.2p12, FLT_MAX, DBL_MAX LDBL_MAX, :

, , , , :

( 1E+37).

, , , FLT_MAX, DBL_MAX LDBL_MAX , float, double, long double, . , , . DBL_MAX, (double)DBL_MAX.

:

#define DBL_MAX 1.79769313486231570815e+308L

long double, , - , .

+3

Source: https://habr.com/ru/post/1668352/


All Articles