[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: While
From: |
Paul Pluzhnikov |
Subject: |
Re: While |
Date: |
Mon, 27 Mar 2006 20:04:06 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux) |
Wilhelm Korrengk <wilhelm@korrengk.de> writes:
>> while (1.e-10 < i) { ... }
> Unfortunately 1.e-10 is not equal to 0;
I think you may be missing the point: 'i' will *never* be equal to 0.
You have to define appropriate epsilon (1.e-10 was just an example).
> That`s why i can "increment" with d += 0.1 up to 0 even if -0.1
If you increment or decrement by 0.1, and if 1.e-10 is not "close
enough" for you, you need to think some more about what you are
actually trying to achieve and whether your algorithm ever halts.
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
- While, Wilhelm Korrengk, 2006/03/26
- Re: While, Paul Pluzhnikov, 2006/03/26
- Re: While, Wilhelm Korrengk, 2006/03/27
- Re: While,
Paul Pluzhnikov <=