Skip to content

Commit

Permalink
Update concepts/booleans/introduction.md
Browse files Browse the repository at this point in the history
Co-authored-by: András B Nagy <[email protected]>
  • Loading branch information
colinleach and BNAndras authored Sep 9, 2024
1 parent e322b73 commit e08b195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion concepts/booleans/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If `x` was 3 they would both be `true`.
We can express statements like "is x less than 5 and not equal to y?" using [Boolean operators][boolean-operators]: `!` (not), `&&` (and), `||` (or).

In Julia (and many other programming languages), `&&` has a [higher precedence][operator-precedence] than `||` (in the same way that `*` is applied before `+`).
This means that `true || false && true` evaluates to `true` because it is parsed as `(true || false) && true`.
This means that `true || false && true` evaluates to `true` because it is parsed as `true || (false && true)`.
It is common to include explicit brackets anyway so that the reader doesn't need to think about this.

### Logical _not_
Expand Down

0 comments on commit e08b195

Please sign in to comment.