#585 was: Quick update
Robert C. Helling
helling at atdotde.de
Thu Jul 3 13:18:36 PDT 2014
On 03 Jul 2014, at 17:44, Dirk Hohndel <dirk at hohndel.org> wrote:
> That is of course blatantly wrong. More coffee. But we test for dive==NULL
> a few lines before the snippet I posted
Now you confused me. The situation is the following: The current dive has divenr=1 and there is one further dive in the dive list (one of which the saturation should be taken into accout) and that has number 0.
So, before the while i=1. In the while condition, the first condition (i) is true. Then i is decremented to i=0 then it is tested again (as i) then the condition fails and the body of the while is not run. But that is wrong since it should be run with i=0 (to set last time accordingly).
I just realised there is another problem: The next while loop starts with ++i, so again the case i=0 is not taken care of (and the first dive in the dive list has no chance to be considered for pre-saturation).
In conclusion, I still maintain the first while should be
while (i>=0 && --i>=0)
Then, in my case, after the loop i=-1 and then after the ++i in the while i=0 is possible in the next loop.
Best
Robert
--
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling Elite Master Course Theoretical and Mathematical Physics
Scientific Coordinator
Ludwig Maximilians Universitaet Muenchen, Dept. Physik
print "Just another Phone: +49 89 2180-4523 Theresienstr. 39, rm. B339
stupid .sig\n"; http://www.atdotde.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140703/ce2078f3/attachment.sig>
More information about the subsurface
mailing list