Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Few days ago,I had a problem solving elementary equations in flash action script 3. I asked here and got an anwer ,I thank him very much.

  1. How to safely solve a pair of elementary equations in a floating point computing system?

I temporary fixed the program to replace any equation representing a straight line almost parallel to y axis by a new line completely parallel to y axis. Currently it seems that the fixed program finds the meeting point of 2 straight lines correctly if they are not parallel to each other.

Then , let me ask you my new question. If I use Matlab to solve the same problems , do I also need to do similar checking relating "cancellation of digits"?

Thanks in advance.

share|cite|improve this question
up vote 2 down vote accepted

I know Mathematica, and believe Matlab, distinguishes between exact values (like integers, fractions, $\pi$, etc.) and approximate values (1.1023). Calculations with exact values are exact (when possible) and will not suffer from cancellation. It will be able to do $\frac1{10^9}-\frac1{10^9+1}=\frac1{10^{18}+10^9}$ accurately, with no loss of precision. If you ask for $0.000000001-0.00000000999999999000000000999999999$ you will lose precision because they are approximate numbers.

share|cite|improve this answer
Mathematica does this, Matlab does not. Matlab stores numbers as ordinary floating point values, and will suffer from the same problems Actionscript does. – Samuel Jan 21 '12 at 6:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.