Browse Source

add logarithmic function for all bases

master
fdai7848 11 months ago
parent
commit
c83f6e9b4b
  1. 7
      src/logarithmus.c
  2. 1
      src/logarithmus.h

7
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;

1
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
Loading…
Cancel
Save