[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53690] incorrect test in delaunayn?
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #53690] incorrect test in delaunayn? |
Date: |
Wed, 18 Apr 2018 13:42:03 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Update of bug #53690 (project octave):
Status: None => Invalid
Open/Closed: Open => Closed
Release: 4.3.90 => dev
_______________________________________________________
Follow-up Comment #1:
This is okay. See the documentation for the if statement in the Octave
manual.
The condition in an if statement is considered true if its value is nonzero,
and false if
its value is zero. If the value of the conditional expression in an if
statement is a vector or
a matrix, it is considered true only if it is non-empty and all of the
elements are nonzero.
The conceptually equivalent code when condition is a matrix is shown below.
if (matrix) ≡ if (all (matrix(:)))
And as an example,
if ([1 0 1])
disp ("1 0 1 is true");
else
disp ("1 0 1 is false");
endif
1 0 1 is false
But,
if ([1 1 1])
disp ("1 1 1 is true");
else
disp ("1 1 1 is false");
endif
1 1 1 is true
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?53690>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/