I made a very simple code which calculates the values of a function:
#define MIN 0.00001
#define MAX 1
#define MAXP 10000
double func_log(double x)
{
double r=RPWN;
printf(" MAXP = %e \n",MAXP);
printf(" MIN = %e \n",MIN);
printf(" MAX = %e \n",MAX);
double y;
if (x>r || x==0) return(0.0);
else {
y = r+((r*r)/(2.*x)-x/2.)*log((1+r/x)/(r/x-1));
}
return y;
}
That fonction is in a file.c which is compiled with other source files. The problem is that MAXP
cannot be set to its value. Here is what I get when I ask to print out the values of MIN
, MAXP
, and MAXP
:
MAXP = 4.940656e-324
MIN = 1.000000e-05
MAX = 1.000000e+00
I really don't understand why I get 4.940656e-324
for MAXP
, I never had such issue. Also when I write #define MAXP 10000.
, I then get MAXP = 1.000000e+04
. I compile with gcc, does someone has any clue?