|
@ -26,8 +26,8 @@ double floor(double num1); |
|
|
double round(double num1); |
|
|
double round(double num1); |
|
|
double fmax(double num1,double num2); |
|
|
double fmax(double num1,double num2); |
|
|
double log10(double num1); |
|
|
double log10(double num1); |
|
|
//double exp2(double num1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double exp2(double num1); |
|
|
|
|
|
double fmin(double num1, double num2); |
|
|
int calculator() { |
|
|
int calculator() { |
|
|
int choice; |
|
|
int choice; |
|
|
double num1, num2, result; |
|
|
double num1, num2, result; |
|
@ -92,8 +92,8 @@ double log10(double num1); |
|
|
printf("23. Round\n"); |
|
|
printf("23. Round\n"); |
|
|
printf("24. fmaximum"); |
|
|
printf("24. fmaximum"); |
|
|
printf("25. base 10 logarithm"); |
|
|
printf("25. base 10 logarithm"); |
|
|
// printf("26. 2 raise to the power"); |
|
|
|
|
|
// printf("27 trunc"); |
|
|
|
|
|
|
|
|
printf("26. 2 raise to the power"); |
|
|
|
|
|
printf("27. fminimum"); |
|
|
printf("28. Exit\n"); |
|
|
printf("28. Exit\n"); |
|
|
} |
|
|
} |
|
|
double performOperation(int choice, double num1, double num2) { |
|
|
double performOperation(int choice, double num1, double num2) { |
|
@ -149,10 +149,10 @@ double log10(double num1); |
|
|
return 0; fmax(num1,num2); |
|
|
return 0; fmax(num1,num2); |
|
|
case 25: |
|
|
case 25: |
|
|
return 0; log10(num1); |
|
|
return 0; log10(num1); |
|
|
// case 26: |
|
|
|
|
|
// return 0; exp2(num1); |
|
|
|
|
|
// case 27: |
|
|
|
|
|
// return 0; trunc(num1); |
|
|
|
|
|
|
|
|
case 26: |
|
|
|
|
|
return 0; exp2(num1); |
|
|
|
|
|
case 27: |
|
|
|
|
|
return 0; fmin(num1,num2); |
|
|
default: |
|
|
default: |
|
|
return 0.0; |
|
|
return 0.0; |
|
|
} |
|
|
} |
|
@ -253,13 +253,13 @@ double fmax(double num1 , double num2){ |
|
|
double log10(double num1){ |
|
|
double log10(double num1){ |
|
|
double result = num1; |
|
|
double result = num1; |
|
|
return result; |
|
|
return result; |
|
|
}/* |
|
|
|
|
|
double log10(double num1){ |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
double exp2(double num1){ |
|
|
double result = num1; |
|
|
double result = num1; |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
double trunc(double num1){ |
|
|
|
|
|
double result = num1; |
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
double fmin(double num1,double num2){ |
|
|
|
|
|
double minimum = fmin(num1,num2); |
|
|
|
|
|
return minimum; |
|
|
} |
|
|
} |
|
|
*/ |
|
|
|
|
|
|
|
|
|