help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ranges (was Numerical issues with sin()/cos() )


From: Przemek Klosowski
Subject: Re: ranges (was Numerical issues with sin()/cos() )
Date: Fri, 30 Mar 2018 12:55:23 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/30/2018 12:39 PM, Ian McCallion wrote:
Thanks, though for equivalence I would need:

   ct=0;
   while true
       ct++;
       if condition; break
   endwhile

Which makes my version more compact familiar and readable.

The syntax of C++, java and no doubt many other languages allows use of the for loop with no end test. That Octave should join the crowd is all I was thinking.

the 1:inf would not work in C++/java, and I'd argue is not very clear or readable either. If you just want to avoid end test, how about:

while ++c

  if condition break endif

endwhile

although of course  you'd have to watch for c=0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]