Friday, February 5, 2010

Graphica Math Kit, Fixing the Calculator Problem !

Hi , this is my first technical post, and what a strange thing to start by a bug from a software that I helped developing about 9 years ago, after my first year as an undergraduate student :) ...
"Graphica Math Kit", is a free mathematical and graphical software that can help students studying calculus and math.

However, for those who used the "Scientific Calculator" tool, you may have already noticed that is has a problem, this post explains the problem and, fortunately, its solution.


The problem is when you type and expression that contains any of these functions:
(log, ln, sin, cos, tan, sec, csc, cot, etc ...)
or the factorial (e.g. !3)
or the negative sign (e.g. -3)
the final computed result is not correct, for example:

3+cos(60)+1

the result is 4.5 ... however, when you use the calculator it shows:




the result is 1.5 !!, so after some trials I found a solution to this problem, just put any of those functions inside 2 brackets of its own, so the correction for the previous expression is:

3+( cos(60) )+1





here are some examples for further clarification:



Expressions that causes the problem

Correction of the expression

3+log(100)+1

3+( log(100) )+1

4*acos(.5)/2

4*( acos(.5) )/2

6+ cos(0.6-sin(30)+0.2) *2

6+( cos(0.6-( sin(30) )+0.2) )*2

5+ln(e)*2

5+( ln(e) )*2

2*-1+2

2*( -1 )+2

7*!3/2

7*( !3 )/2

hope this helps :) ...