diff --git a/src/logarithmus.c b/src/logarithmus.c index b5bc971..248622c 100644 --- a/src/logarithmus.c +++ b/src/logarithmus.c @@ -4,6 +4,13 @@ #include "logarithmus.h" #include "exponent.h" +double logX(double b, double a){ + if(b == 1.0 || b < 0.0){ + return -1.0; + } + return(logN(a, 0.000001)/logN(b, 0.000001)); +} + double logN(double x, double eps){ if(x <= 0){ return -1.0; diff --git a/src/logarithmus.h b/src/logarithmus.h index 9447319..4294276 100644 --- a/src/logarithmus.h +++ b/src/logarithmus.h @@ -2,5 +2,6 @@ #define LOGARITHMUS_H double logN(double x, double eps); +double logX(double b, double a); #endif // logarithmus.h \ No newline at end of file