Merge branch 'main' into v0.16
This commit is contained in:
@@ -245,7 +245,7 @@ and could write $\lvert x-5\rvert > 7$ as
|
|||||||
(x - 5 < -7) || (x - 5 > 7)
|
(x - 5 < -7) || (x - 5 > 7)
|
||||||
```
|
```
|
||||||
|
|
||||||
(The first expression is false for $x=18$ and the second expression true, so the "or"ed result is `true` and the "and" result if `false`.)
|
(The first expression is false for $x=18$ and the second expression true, so the "or"ed result is `true` and the "and" result is `false`.)
|
||||||
|
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
@@ -286,7 +286,7 @@ The table in the manual on [operator precedence and associativity](https://docs.
|
|||||||
|
|
||||||
|
|
||||||
```{julia}
|
```{julia}
|
||||||
((x-5) < -7) && ((x-5) > 7)
|
((x-5) < -7) || ((x-5) > 7)
|
||||||
```
|
```
|
||||||
|
|
||||||
(This is different than the precedence of the bitwise boolean operators, which have `&` with "Multiplication" and `|` with "Addition", so `x-5 < 7 | x - 5 > 7` would need parentheses.)
|
(This is different than the precedence of the bitwise boolean operators, which have `&` with "Multiplication" and `|` with "Addition", so `x-5 < 7 | x - 5 > 7` would need parentheses.)
|
||||||
|
|||||||
@@ -486,11 +486,11 @@ The `sort` function will rearrange the values in `𝒗`:
|
|||||||
sort(𝒗)
|
sort(𝒗)
|
||||||
```
|
```
|
||||||
|
|
||||||
The keyword argument, `rev=false` can be given to get values in decreasing order:
|
The keyword argument, `rev=true` can be given to get values in decreasing order:
|
||||||
|
|
||||||
|
|
||||||
```{julia}
|
```{julia}
|
||||||
sort(𝒗, rev=false)
|
sort(𝒗, rev=true)
|
||||||
```
|
```
|
||||||
|
|
||||||
For adding a new element to a vector the `push!` method can be used, as in
|
For adding a new element to a vector the `push!` method can be used, as in
|
||||||
@@ -722,7 +722,7 @@ For example, here a named tuple is constructed, and then its elements referenced
|
|||||||
|
|
||||||
```{julia}
|
```{julia}
|
||||||
nt = (one=1, two="two", three=:three) # heterogeneous values (Int, String, Symbol)
|
nt = (one=1, two="two", three=:three) # heterogeneous values (Int, String, Symbol)
|
||||||
nt.one, nt[2], n[end] # named tuples have name or index access
|
nt.one, nt[2], nt[end] # named tuples have name or index access
|
||||||
```
|
```
|
||||||
|
|
||||||
## Questions
|
## Questions
|
||||||
|
|||||||
Reference in New Issue
Block a user