help-octave
[Top][All Lists]
Advanced

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

Re: help - warning division by zero


From: Andrew Janke
Subject: Re: help - warning division by zero
Date: Fri, 25 Oct 2019 02:36:12 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0


On 10/25/19 2:32 AM, Joe Tusek wrote:
> -----Original Message-----
> From: Andrew Janke <address@hidden> 
> Sent: Friday, 25 October 2019 5:22 PM
> To: Joe Tusek <address@hidden>; address@hidden
> Subject: Re: help - warning division by zero
> 
> If you want real short-circuiting behavior, you'll have to use regular 
> "if/else" statements at the Octave/M-code syntax level. You can write them as 
> one-liners if you really want:
> 
> if 1==1; 0 else 1/0; end
> 
> 
> No warning happens when you do it this way.
> 
> Cheers,
> Andrew
> 
> 
> Now it all makes sense. 
> I can't use it with that behaviour as it will confuse users about whether the 
> division by zero affected the outcome. I will just have to do it longhand . 
> Thanks.

You're welcome! Sorry we don't have a more convenient answer for you,
but that's how you have to do it.

Glad we could clear that up.

Cheers,
Andrew



reply via email to

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