octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #61473] unexpected results from eq


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #61473] unexpected results from eq
Date: Sun, 14 Nov 2021 09:15:20 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36 Edg/95.0.1020.53

Follow-up Comment #5, bug #61473 (project octave):

`isequal` checks if its two inputs are equal. `eq` (same as `==` operator)
checks each *element* of its inputs for equality.

So, `isequal([], [])` returns `true` because both inputs are "equal". `[] ==
[]` returns `[]` because there are no elements to check equality for. `[1 2 3]
== 1` returns `[true false false]` because of broadcasting rules. Similarly
`[] == 1` returns `[]` as an extension of the same "broadcasting" rules.

One is an element-wise operation, the other one is not.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61473>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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