Hints:
creal
,
creall
,
cimag
,
cimagl
functions (read man creal
and man cimag
).
complex.h
defines the imaginary unit as I
.
math.h
defines
M_E
(the value of e) and M_PI
(the value
of π). If not, you can define this constants (in double precision) as
# define M_E 2.7182818284590452354 /* e */ # define M_PI 3.1415926535897932384 /* pi */
float
, double
, and long double
hold in them by trying to store the number
0.1111111111111111111111111111
in the variable and then printing out what is stored. The long
double
number must end with L:
long double x = 0.1111111111111111111111111111L;otherwise it will be considered as double and truncated. Print numbers with format placeholders "%.25g" for float, "%.25lg" for double, "%.25Lg" for long double.