> I encountered a problem with floating point arithmetic that I'm afraid
> may be causing greater calculation errors in my program.  The program
> I'm writing calculates numerical solutions for ordinary differential
> equations (http://sid.cwru.edu/perl/euler.pl).   What's happening is
> that floating point storage is not rounding off properly and down the
> line 2.4 + 0.025 = 2.42499999999999 instead of 2.425.  

This is to be expected.

And unless you start using some module for rational numbers 
aritmetic (which will be SLOW!) you CAN'T do anything about that.

Apropos, did you know that 1 and 0.9999999...(ad infinitum) are 
THE SAME NUMBER?

        1 = 1
        9/9 = 1
        9 * (1/9) = 1
        9 * 0.1111111.... = 1
        0.99999999..... = 1

;-)

> The resulting error in my particular differential equation is 2/10^15
> which is fine exept the the error gets compounded over a few hundred
> iterations.  Does anyone have any suggestions for how to improve upon
> this?  I do understand that there are accuracy limitations with
> floating pt. nums.

Aparently not. But I have to say I'm not that good in this area either 
.... it has been some time since I've been taught numerical math ...

Hope someone may give you some URLs.

Jenda

=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
                                        --- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to