diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/calculator.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index eb1e613ff1..108b17c9e8 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c | |||
@@ -228,7 +228,6 @@ enum { sci_fac, sci_pi , sci_sci , sci_sin , sci_asin , | |||
228 | sci_0 , sci_sign , sci_dot , sci_log , sci_xy | 228 | sci_0 , sci_sign , sci_dot , sci_log , sci_xy |
229 | }; | 229 | }; |
230 | 230 | ||
231 | #define PI 3.14159265358979323846 | ||
232 | #define MINIMUM 0.000000000001 /* e-12 */ | 231 | #define MINIMUM 0.000000000001 /* e-12 */ |
233 | /* ^ ^ ^ ^ */ | 232 | /* ^ ^ ^ ^ */ |
234 | /* 123456789abcdef */ | 233 | /* 123456789abcdef */ |
@@ -505,7 +504,7 @@ double mySqrt(double square) | |||
505 | ----------------------------------------------------------------------- */ | 504 | ----------------------------------------------------------------------- */ |
506 | void transcendFunc(char* func, double* tt, int* ttPower) | 505 | void transcendFunc(char* func, double* tt, int* ttPower) |
507 | { | 506 | { |
508 | double t = (*tt)*PI/180; int tPower = *ttPower; | 507 | double t = (*tt)*M_PI/180; int tPower = *ttPower; |
509 | int sign = 1; | 508 | int sign = 1; |
510 | int n = 50; /* n <=50, tables are all <= 50 */ | 509 | int n = 50; /* n <=50, tables are all <= 50 */ |
511 | int j; | 510 | int j; |
@@ -539,15 +538,15 @@ void transcendFunc(char* func, double* tt, int* ttPower) | |||
539 | tPower++; | 538 | tPower++; |
540 | } | 539 | } |
541 | j = 0; | 540 | j = 0; |
542 | while (t > j*2*PI) {j++;} | 541 | while (t > j*M_TWOPI) {j++;} |
543 | t -= (j-1)*2*PI; | 542 | t -= (j-1)*M_TWOPI; |
544 | if (PI/2 < t && t < 3*PI/2){ | 543 | if (M_PI_2 < t && t < 3*M_PI_2){ |
545 | t = PI - t; | 544 | t = M_PI - t; |
546 | if (func[0] =='c' || func[0] =='C') | 545 | if (func[0] =='c' || func[0] =='C') |
547 | sign = -1; | 546 | sign = -1; |
548 | } | 547 | } |
549 | else if ( 3*PI/2 <= t && t <= 2*PI) | 548 | else if ( 3*M_PI_2 <= t && t <= M_TWOPI) |
550 | t -= 2*PI; | 549 | t -= M_TWOPI; |
551 | 550 | ||
552 | x = 0.60725293500888; y = 0; z = t; | 551 | x = 0.60725293500888; y = 0; z = t; |
553 | for (j=1;j<n+2;j++){ | 552 | for (j=1;j<n+2;j++){ |
@@ -1309,7 +1308,7 @@ void sciButtonsProcess(void){ | |||
1309 | switch( CAL_BUTTON ){ | 1308 | switch( CAL_BUTTON ){ |
1310 | 1309 | ||
1311 | case sci_pi: | 1310 | case sci_pi: |
1312 | result = PI; power = 0; | 1311 | result = M_PI; power = 0; |
1313 | calStatus = cal_normal; | 1312 | calStatus = cal_normal; |
1314 | break; | 1313 | break; |
1315 | 1314 | ||