|
@ -3,6 +3,13 @@ |
|
|
|
|
|
|
|
|
#include "exponent.h" |
|
|
#include "exponent.h" |
|
|
|
|
|
|
|
|
|
|
|
double absD(double x){ |
|
|
|
|
|
if(x<0){ |
|
|
|
|
|
return -1 * x; |
|
|
|
|
|
} |
|
|
|
|
|
return x; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
double expI(double e, double num){ |
|
|
double expI(double e, double num){ |
|
|
double prod = 1.0; |
|
|
double prod = 1.0; |
|
|
if(e==0.0){ |
|
|
if(e==0.0){ |
|
@ -16,16 +23,16 @@ double expI(double e, double num){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
double expIN(double e, double num){ |
|
|
double expIN(double e, double num){ |
|
|
if(e - ((int) e) < 0.000001 || e - ((int) e) > -0.000001){ |
|
|
|
|
|
if(e>0){ |
|
|
|
|
|
|
|
|
if(absD(e) - ((int) absD(e)) < 0.000001){ |
|
|
|
|
|
if(e>0.0){ |
|
|
return expI(e, num); |
|
|
return expI(e, num); |
|
|
} |
|
|
} |
|
|
else{ |
|
|
else{ |
|
|
return (1.0 / expI((e*-1), num)); |
|
|
return (1.0 / expI((e*-1), num)); |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
if(e>0){ |
|
|
|
|
|
return exponential(e*logN(num, 0.000001)); |
|
|
|
|
|
|
|
|
if(e>0.0){ |
|
|
|
|
|
return exponential(e*logN(num, 0.00000001)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return 0; |
|
|
return 0; |
|
@ -52,12 +59,7 @@ double exponential(double x){ |
|
|
return sum; |
|
|
return sum; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
double absD(double x){ |
|
|
|
|
|
if(x<0){ |
|
|
|
|
|
return -1 * x; |
|
|
|
|
|
} |
|
|
|
|
|
return x; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double logN(double x, double eps){ |
|
|
double logN(double x, double eps){ |
|
|
if(x <= 0){ |
|
|
if(x <= 0){ |
|
|