|
@ -1,4 +1,5 @@ |
|
|
#include <stdio.h> |
|
|
#include <stdio.h> |
|
|
|
|
|
#include <math.h> |
|
|
#define M_PI 3.14159265358979323 |
|
|
#define M_PI 3.14159265358979323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -11,6 +12,7 @@ double factorial(double num); |
|
|
double permutation(int n, int r); |
|
|
double permutation(int n, int r); |
|
|
double combination(int n, int r); |
|
|
double combination(int n, int r); |
|
|
double pow(double num1, double num2); |
|
|
double pow(double num1, double num2); |
|
|
|
|
|
int mod(int num1,int num2); |
|
|
|
|
|
|
|
|
int calculator() { |
|
|
int calculator() { |
|
|
int choice; |
|
|
int choice; |
|
@ -85,7 +87,7 @@ double pow(double num1, double num2); |
|
|
case 5: |
|
|
case 5: |
|
|
return pow(num1, num2); |
|
|
return pow(num1, num2); |
|
|
case 6: |
|
|
case 6: |
|
|
return 0;// fmod(num1, num2); |
|
|
|
|
|
|
|
|
return 0; fmod(num1, num2); |
|
|
case 7: |
|
|
case 7: |
|
|
return 0;// log(num1); |
|
|
return 0;// log(num1); |
|
|
case 8: |
|
|
case 8: |
|
@ -156,3 +158,7 @@ double pow(double num1, double num2){ |
|
|
} |
|
|
} |
|
|
return product; |
|
|
return product; |
|
|
} |
|
|
} |
|
|
|
|
|
int mod(int num1, int num2){ |
|
|
|
|
|
int result = num1%num2; |
|
|
|
|
|
return result; |
|
|
|
|
|
} |