On 4/11/07, Jay Belanger <belanger at truman.edu> wrote:
>
> "Stavros Macrakis" <macrakis at alum.mit.edu> writes:
> > To how many digits? What are the results for (3*1.4^2)-5.88 or
> (5/9)*9-5? or sin
> > (3.1415926535897932385/4)-sqrt(1/2)?
>
> (1) -> (3*1.4^2) - 5.88
> (1) 0.0
> Type: Float
Interesting. It would require some experimentation to figure out what is
actually going on here.
And what does the calculator say?
(2) -> (5/9)*9-5
> (2) 0 Type:
> Fraction Integer
I intended this example for the calculator -- clearly both Axiom and Maxima
do exact rational arithmetic. But if you want to compare on Axiom, try (5.0
/9.0)*9.0-5.0.
(3) -> sin(3.1415926535897932385/4)-sqrt(1/2)
> (3) 0.1 E -19
>
> I don't know how Axiom operates. This may just be a rounding-on-display
> issue, or it
> > may actually calculate the answer differently internally (decimal
> floats? rationals?)
>
> I don't know much about the Axiom internals, either.
>
> > Your pocket calculator may operate in decimal floating-point, in which
> case it will
> > get exact answers for 3*1.4^2 and the like, but not for other
> calculations.
>
> Interesting. I realize that calculators typically only give
> approximations, but when does it give the wrong answer when you'd
> expect the right one? (I have no doubt such cases exist; I just don't
> know one offhand.)
You will have to experiment. Different calculators probably give different
results (or are they all using the same core these days...?).
> Do you have any suggestions on how to improve things?
>
> No; I'm not being very helpful.
>
-s