Browse Source

Added logarithmBase2Function for base 2 logarithmic calculations

remotes/origin/feature
fdai7782 11 months ago
parent
commit
03d5c29ff6
  1. 6
      src/main/c/main_taschenrechner.c
  2. 2
      src/main/c/taschenrechner.h

6
src/main/c/main_taschenrechner.c

@ -39,6 +39,7 @@ double tangentFunction(double angle) {
return tan(angle * M_PI / 180.0);
}
//..
// Logarithmic functions
double logarithmFunction(double x) {
// Logarithm with base 10
@ -49,8 +50,11 @@ double naturalLogarithmFunction(double x) {
// Natural logarithm (ln)
return log(x);
}
double logarithmBase2Function(double x) {
// Logarithm with base 2
return log2(x);
}
// scientificmode
int scientificMode(){

2
src/main/c/taschenrechner.h

@ -22,6 +22,8 @@ double logarithmFunction(double x);
double naturalLogarithmFunction(double x);
double logarithmBase2Function(double x);
int mode(int userChoice);
int displayMenu();

Loading…
Cancel
Save