[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Precision
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 30 Aug 2001 10:57:01 -0300 (EST)
> Could anyone tell me if this is supposed to happen? It didn't look very good on my numerical analysis class. :-)
Are you taking a numerical analysis course?
Didn't they tell you that real numbers are represented in floating-point and
that most numbers are not *exactly* representable?
0.15 is not exactly representable in binary and so adding it several times
is not the same as adding a multiple of it.
Try 0.125 instead (0.125 *is* exactly representable in binary)
--lhf