This is an issue of floating point arithmetic. You will find it in *any*
programming language when you multiply floating point values: C, C++,
Java, Fortran, Perl, Python, etc.
What you need to do is become familiar with the limitations of floating
point operations so that you can make an intelligent decision as to when
it is appropriate to use it and when you need to use integers.
Unlike most programming languages, a CAS like Maxima allows you to work
with fractions, giving you the benefit of exact arithmetic.
To learn more, read the Wikipedia article on floating point arithmetic
and precision.
Daniel.
On 11/30/2011 12:02 AM, Dan wrote:
> Hello,
>
> I'm a new maxima user and new to this list. Maxima is an excellent free
> computation software. I like it.
>
> However, the following sort of errors made me a little bit upset when i
> was doing numerical computation.
> I can understand that errors will be introduced during the transformation
> between representation of binary and decimal systems.
>
> %i1) 12.3*70.95
> %o1) 872.6850000000001
>
> while
>
> %i2) 123*7095
> %o2) 872685
>
> ( I did this with maxima 5.25 on a fedora 16 x8664 laptop)
>
> I don't know much about how does maxima do it internally. This kind of
> errors is difficult to detect and track. I want to find out a more
> safely way of doing this kind of calculation, which ensures that it
> won't introduce such errors.
>
> Could anyone give some suggestions on how to do it correctly?
>
> Dan C.
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
--
I'm not overweight, I'm undertall.