Skip to content

Commit 8552817

Browse files
authored
Update mathematical-operations.md (#36065)
* Update mathematical-operations.md Apply some remaining review suggestions from #35996 * Use @ref links
1 parent 9b822ec commit 8552817

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

doc/src/manual/mathematical-operations.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ are supported on all primitive numeric types:
2222
| `x ^ y` | power | raises `x` to the `y`th power |
2323
| `x % y` | remainder | equivalent to `rem(x,y)` |
2424

25-
as well as the negation on [`Bool`](@ref) types:
26-
27-
| Expression | Name | Description |
28-
|:---------- |:-------- |:---------------------------------------- |
29-
| `!x` | negation | changes `true` to `false` and vice versa |
30-
3125
A numeric literal placed directly before an identifier or parentheses, e.g. `2x` or `2(x+y)`, is treated as a multiplication, except with higher precedence than other binary operations. See [Numeric Literal Coefficients](@ref man-numeric-literal-coefficients) for details.
3226

3327
Julia's promotion system makes arithmetic operations on mixtures of argument types "just work"
@@ -65,17 +59,18 @@ This is useful for preventing the propagation of `NaN` values in quantities that
6559

6660
## Boolean Operators
6761

68-
The following [Boolean operators](https://en.wikipedia.org/wiki/Boolean_algebra#Operations) are supported on `Bool`:
62+
The following [Boolean operators](https://en.wikipedia.org/wiki/Boolean_algebra#Operations) are supported on [`Bool`](@ref) types:
63+
64+
| Expression | Name |
65+
|:---------- |:--------------------------------------------------------|
66+
| `!x` | negation |
67+
| `x && y` | [short-circuiting and](@ref man-conditional-evaluation) |
68+
| `x \|\| y` | [short-circuiting or](@ref man-conditional-evaluation) |
6969

70-
| Expression | Name |
71-
|:---------- |:--------------------------------------|
72-
| `!x` | not |
73-
| `x && y` | [short-circuiting and][short-circuit] |
74-
| `x \|\| y` | [short-circuiting or][short-circuit] |
70+
Negation changes `true` to `false` and vice versa. The short-circuiting opeations are explained on the linked page.
7571

7672
Note that `Bool` is an integer type and all the usual promotion rules and numeric operators are also defined on it.
7773

78-
[short-circuit]: https://docs.julialang.org/en/v1/manual/control-flow/#Short-Circuit-Evaluation-1
7974
## Bitwise Operators
8075

8176
The following [bitwise operators](https://en.wikipedia.org/wiki/Bitwise_operation#Bitwise_operators)

0 commit comments

Comments
 (0)