Double_t in C99

I just read that C99 has double_t, which should be at least wide than double. Does this mean that it gives more accurate digits after the decimal point? More than the usual 15 digits for double ?.

Secondly, how to use it: includes only

#include <float.h> 

enough? I read that you need to set FLT_EVAL_METHOD to 2 for a long double. How to do it? Since I work with numerical methods, I would like to get maximum accuracy without using an arbitrary precision library.

Thanks a lot...

+5
source share
3 answers

No. double_tno less than double; that is, it can be the same as double. Footnote 190 in the C99 standard makes the goal clear:

float_t double_t , , float double, .

, FLT_EVAL_METHOD.

C99, long double. , , double ( , float).

, " ", , ( ) , , . , . , ?

: , (a) long double , (b) , , , , .

+5

, FLT_EVAL_METHOD - , , .

, , .

, , , double_t double . , - , double_t long double, , FLT_EVAL_METHOD == 2 .

, FLT_EVAL_METHOD - 0, 1 2, , , double_t.

+1

double_tcan be defined typedef double double_t;- of course, if you plan to rely on implementation specifics, you need to look at your own implementation.

0
source

All Articles