Skip to content

Commit bb5132f

Browse files
bkaminsfredrikekre
authored andcommitted
Fix logical operators on arrays example (#23930)
Currently using `|` gives deprecation warning. The correct operator is `.|`.
1 parent 9f3d200 commit bb5132f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/src/manual/noteworthy-differences.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ may trip up Julia users accustomed to MATLAB:
6363
bitwise operations equivalent to `and`, `or`, and `xor` respectively in MATLAB, and have precedence
6464
similar to Python's bitwise operators (unlike C). They can operate on scalars or element-wise
6565
across arrays and can be used to combine logical arrays, but note the difference in order of operations:
66-
parentheses may be required (e.g., to select elements of `A` equal to 1 or 2 use `(A .== 1) | (A .== 2)`).
66+
parentheses may be required (e.g., to select elements of `A` equal to 1 or 2 use `(A .== 1) .| (A .== 2)`).
6767
* In Julia, the elements of a collection can be passed as arguments to a function using the splat
6868
operator `...`, as in `xs=[1,2]; f(xs...)`.
6969
* Julia's [`svd`](@ref) returns singular values as a vector instead of as a dense diagonal matrix.

0 commit comments

Comments
 (0)