Skip to content

Commit

Permalink
Note that && and || are and and or. (JuliaLang#37463)
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquebecker91 committed Dec 15, 2020
1 parent 74a08fe commit da38c6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/src/manual/control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ short-circuit behavior, but beware that `&` and `|` have higher precedence than
Short-circuit evaluation is quite similar to conditional evaluation. The behavior is found in
most imperative programming languages having the `&&` and `||` boolean operators: in a series
of boolean expressions connected by these operators, only the minimum number of expressions are
evaluated as are necessary to determine the final boolean value of the entire chain. Explicitly,
this means that:
evaluated as are necessary to determine the final boolean value of the entire chain. Some
languages (like Python) refer to them as `and` (`&&`) and `or` (`||`). Explicitly, this means
that:

* In the expression `a && b`, the subexpression `b` is only evaluated if `a` evaluates to `true`.
* In the expression `a || b`, the subexpression `b` is only evaluated if `a` evaluates to `false`.
Expand Down

0 comments on commit da38c6b

Please sign in to comment.