Skip to content

Commit

Permalink
Fixes MicrosoftDocs#6724 - update operator precedence info (Microsoft…
Browse files Browse the repository at this point in the history
…Docs#6726)

* Update Readme file

* Fixes MicrosoftDocs#6724 - update operator precedence info

* feedback
  • Loading branch information
sdwheeler authored Oct 9, 2020
1 parent 8195f84 commit 6cffcfa
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 112 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ The following list describes the main folders in this repository.
general, the folder structure mirrors the Table of Contents (TOC).
- `mapping` - contains the version mapping configuration used by the build system
- `media` - contains image files used in documentation. There are media folders throughout the
`conceptual` content. See the Contributor Guide for information on using images in documentation.
`docs-conceptual` content. See the Contributor Guide for information on using images in documentation.
- `module` - contains the markdown source for the Module Browser page
- `tests` - contains the Pester tests used by the build system
- `tools` - contains other tools used by the build system

> [!NOTE]
> The reference content (in the numbered folders) is used to create the webpages on the Docs site as
> well as the updateable help used by PowerShell. The articles in the `docs-conceptual` folder are
> only published to the Docs website.
> NOTE: The reference content (in the numbered folders) is used to create the
> webpages on the Docs site as well as the updateable help used by PowerShell.
> The articles in the `docs-conceptual` folder are only published to the Docs
> website.
## Contributing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keywords: powershell,cmdlet
Locale: en-US
ms.date: 07/17/2020
ms.date: 10/08/2020
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_arithmetic_operators?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Arithmetic_Operators
Expand Down Expand Up @@ -52,8 +52,7 @@ PowerShell supports the following arithmetic operators:
|-bnot |Bitwise NOT |`-bnot 5` |
|-bor |Bitwise OR |`5 -bor 0x03` |
|-bxor |Bitwise XOR |`5 -bxor 3` |
|-shl |Shifts bits to the left the |`102 -shl 2` |
| |specified number of times | |
|-shl |Shifts bits to the left |`102 -shl 2` |
|-shr |Shifts bits to the right |`102 -shr 2` |

The bitwise operators only work on integer types.
Expand All @@ -62,12 +61,15 @@ The bitwise operators only work on integer types.

PowerShell processes arithmetic operators in the following order:

|Precedence|Operator |Description |
|----------|---------------|---------------------------------------|
|1 | `()` |Parentheses |
|2 | `-` |For a negative number or unary operator|
|3 | `*`, `/`, `%` |For multiplication and division |
|4 | `+`, `-` |For addition and subtraction |
|Precedence|Operator |Description |
|----------|------------------|---------------------------------------|
|1 | `()` |Parentheses |
|2 | `-` |For a negative number or unary operator|
|3 | `*`, `/`, `%` |For multiplication and division |
|4 | `+`, `-` |For addition and subtraction |
|5 | `-band`, `-bnot` |For bitwise operations |
|5 | `-bor`, `-bxor` |For bitwise operations |
|5 | `-shr`, `-shl` |For bitwise operations |

PowerShell processes the expressions from left to right according to the
precedence rules. The following examples show the effect of the precedence
Expand Down Expand Up @@ -522,11 +524,11 @@ right operand determine how many bits of the left operand are shifted.

## SEE ALSO

* [about_arrays](about_Arrays.md)
* [about_assignment_operators](about_Assignment_Operators.md)
* [about_comparison_operators](about_Comparison_Operators.md)
* [about_hash_tables](about_Hash_Tables.md)
* [about_operators](about_Operators.md)
* [about_variables](about_Variables.md)
* [Get-Date](xref:Microsoft.PowerShell.Utility.Get-Date)
* [New-TimeSpan](xref:Microsoft.PowerShell.Utility.New-TimeSpan)
- [about_arrays](about_Arrays.md)
- [about_assignment_operators](about_Assignment_Operators.md)
- [about_comparison_operators](about_Comparison_Operators.md)
- [about_hash_tables](about_Hash_Tables.md)
- [about_operators](about_Operators.md)
- [about_variables](about_Variables.md)
- [Get-Date](xref:Microsoft.PowerShell.Utility.Get-Date)
- [New-TimeSpan](xref:Microsoft.PowerShell.Utility.New-TimeSpan)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keywords: powershell,cmdlet
Locale: en-US
ms.date: 05/06/2020
ms.date: 10/08/2020
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_operator_precedence?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Operator_Precedence
Expand Down Expand Up @@ -73,7 +73,7 @@ order:

| OPERATOR | REFERENCE |
| --------------------------------------- | ------------------------------ |
| `-band -bnot -bor -bxor` | [about_Arithmetic_Operators][] |
| `-band -bnot -bor -bxor -shr -shl` | [about_Arithmetic_Operators][] |
| `-and -or -xor` | [about_Logical_Operators][] |

The following items are not true operators. They are part of PowerShell's
Expand Down
11 changes: 6 additions & 5 deletions reference/5.1/Microsoft.PowerShell.Core/About/about_Operators.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keywords: powershell,cmdlet
Locale: en-US
ms.date: 09/23/2020
ms.date: 10/08/2020
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_operators?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Operators
Expand All @@ -28,6 +28,9 @@ returns the specified number of copies of each element. You can use arithmetic
operators on any .NET type that implements them, such as: `Int`, `String`,
`DateTime`, `Hashtable`, and Arrays.

Bitwise operators (`-band`, `-bor`, `-bxor`, `-bnot`, `-shl`, `-shr`)
manipulate the bit patterns in values.

For more information, see [about_Arithmetic_Operators](about_Arithmetic_Operators.md).

### Assignment Operators
Expand All @@ -54,9 +57,6 @@ reference set (`-in`, `-notin`, `-contains`, `-notcontains`).
Type comparison operators (`-is`, `-isnot`) determine whether an object is of a
given type.

Bitwise comparison operators (`-band`, `-bor`, `-bxor`, `-bnot`) manipulate the
bit patterns in values.

For more information, see [about_Comparison_Operators](about_Comparison_Operators.md).

### Logical Operators
Expand Down Expand Up @@ -378,7 +378,8 @@ You can also create ranges in reverse order.

#### Member access operator `.`

Accesses the properties and methods of an object. The member name may be an expression.
Accesses the properties and methods of an object. The member name may be an
expression.

```powershell
$myProcess.peakWorkingSet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keywords: powershell,cmdlet
Locale: en-US
ms.date: 07/17/2020
ms.date: 10/08/2020
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_arithmetic_operators?view=powershell-6&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Arithmetic_Operators
Expand Down Expand Up @@ -52,8 +52,7 @@ PowerShell supports the following arithmetic operators:
|-bnot |Bitwise NOT |`-bnot 5` |
|-bor |Bitwise OR |`5 -bor 0x03` |
|-bxor |Bitwise XOR |`5 -bxor 3` |
|-shl |Shifts bits to the left the |`102 -shl 2` |
| |specified number of times | |
|-shl |Shifts bits to the left |`102 -shl 2` |
|-shr |Shifts bits to the right |`102 -shr 2` |

The bitwise operators only work on integer types.
Expand All @@ -62,12 +61,15 @@ The bitwise operators only work on integer types.

PowerShell processes arithmetic operators in the following order:

|Precedence|Operator |Description |
|----------|---------------|---------------------------------------|
|1 | `()` |Parentheses |
|2 | `-` |For a negative number or unary operator|
|3 | `*`, `/`, `%` |For multiplication and division |
|4 | `+`, `-` |For addition and subtraction |
|Precedence|Operator |Description |
|----------|------------------|---------------------------------------|
|1 | `()` |Parentheses |
|2 | `-` |For a negative number or unary operator|
|3 | `*`, `/`, `%` |For multiplication and division |
|4 | `+`, `-` |For addition and subtraction |
|5 | `-band`, `-bnot` |For bitwise operations |
|5 | `-bor`, `-bxor` |For bitwise operations |
|5 | `-shr`, `-shl` |For bitwise operations |

PowerShell processes the expressions from left to right according to the
precedence rules. The following examples show the effect of the precedence
Expand Down Expand Up @@ -522,11 +524,11 @@ right operand determine how many bits of the left operand are shifted.

## SEE ALSO

* [about_arrays](about_Arrays.md)
* [about_assignment_operators](about_Assignment_Operators.md)
* [about_comparison_operators](about_Comparison_Operators.md)
* [about_hash_tables](about_Hash_Tables.md)
* [about_operators](about_Operators.md)
* [about_variables](about_Variables.md)
* [Get-Date](xref:Microsoft.PowerShell.Utility.Get-Date)
* [New-TimeSpan](xref:Microsoft.PowerShell.Utility.New-TimeSpan)
- [about_arrays](about_Arrays.md)
- [about_assignment_operators](about_Assignment_Operators.md)
- [about_comparison_operators](about_Comparison_Operators.md)
- [about_hash_tables](about_Hash_Tables.md)
- [about_operators](about_Operators.md)
- [about_variables](about_Variables.md)
- [Get-Date](xref:Microsoft.PowerShell.Utility.Get-Date)
- [New-TimeSpan](xref:Microsoft.PowerShell.Utility.New-TimeSpan)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keywords: powershell,cmdlet
Locale: en-US
ms.date: 05/06/2020
ms.date: 10/08/2020
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_operator_precedence?view=powershell-6&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Operator_Precedence
Expand Down Expand Up @@ -73,7 +73,7 @@ order:

| OPERATOR | REFERENCE |
| --------------------------------------- | ------------------------------ |
| `-band -bnot -bor -bxor` | [about_Arithmetic_Operators][] |
| `-band -bnot -bor -bxor -shr -shl` | [about_Arithmetic_Operators][] |
| `-and -or -xor` | [about_Logical_Operators][] |

The following items are not true operators. They are part of PowerShell's
Expand Down
11 changes: 6 additions & 5 deletions reference/6/Microsoft.PowerShell.Core/About/about_Operators.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keywords: powershell,cmdlet
Locale: en-US
ms.date: 09/23/2020
ms.date: 10/08/2020
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_operators?view=powershell-6&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Operators
Expand All @@ -28,6 +28,9 @@ returns the specified number of copies of each element. You can use arithmetic
operators on any .NET type that implements them, such as: `Int`, `String`,
`DateTime`, `Hashtable`, and Arrays.

Bitwise operators (`-band`, `-bor`, `-bxor`, `-bnot`, `-shl`, `-shr`)
manipulate the bit patterns in values.

For more information, see [about_Arithmetic_Operators](about_Arithmetic_Operators.md).

### Assignment Operators
Expand All @@ -54,9 +57,6 @@ reference set (`-in`, `-notin`, `-contains`, `-notcontains`).
Type comparison operators (`-is`, `-isnot`) determine whether an object is of a
given type.

Bitwise comparison operators (`-band`, `-bor`, `-bxor`, `-bnot`) manipulate the
bit patterns in values.

For more information, see [about_Comparison_Operators](about_Comparison_Operators.md).

### Logical Operators
Expand Down Expand Up @@ -480,7 +480,8 @@ A

#### Member access operator `.`

Accesses the properties and methods of an object. The member name may be an expression.
Accesses the properties and methods of an object. The member name may be an
expression.

```powershell
$myProcess.peakWorkingSet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keywords: powershell,cmdlet
Locale: en-US
ms.date: 07/17/2020
ms.date: 10/08/2020
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_arithmetic_operators?view=powershell-7&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Arithmetic_Operators
Expand Down Expand Up @@ -52,8 +52,7 @@ PowerShell supports the following arithmetic operators:
|-bnot |Bitwise NOT |`-bnot 5` |
|-bor |Bitwise OR |`5 -bor 0x03` |
|-bxor |Bitwise XOR |`5 -bxor 3` |
|-shl |Shifts bits to the left the |`102 -shl 2` |
| |specified number of times | |
|-shl |Shifts bits to the left |`102 -shl 2` |
|-shr |Shifts bits to the right |`102 -shr 2` |

The bitwise operators only work on integer types.
Expand All @@ -62,12 +61,15 @@ The bitwise operators only work on integer types.

PowerShell processes arithmetic operators in the following order:

|Precedence|Operator |Description |
|----------|---------------|---------------------------------------|
|1 | `()` |Parentheses |
|2 | `-` |For a negative number or unary operator|
|3 | `*`, `/`, `%` |For multiplication and division |
|4 | `+`, `-` |For addition and subtraction |
|Precedence|Operator |Description |
|----------|------------------|---------------------------------------|
|1 | `()` |Parentheses |
|2 | `-` |For a negative number or unary operator|
|3 | `*`, `/`, `%` |For multiplication and division |
|4 | `+`, `-` |For addition and subtraction |
|5 | `-band`, `-bnot` |For bitwise operations |
|5 | `-bor`, `-bxor` |For bitwise operations |
|5 | `-shr`, `-shl` |For bitwise operations |

PowerShell processes the expressions from left to right according to the
precedence rules. The following examples show the effect of the precedence
Expand Down Expand Up @@ -522,11 +524,11 @@ right operand determine how many bits of the left operand are shifted.

## SEE ALSO

* [about_arrays](about_Arrays.md)
* [about_assignment_operators](about_Assignment_Operators.md)
* [about_comparison_operators](about_Comparison_Operators.md)
* [about_hash_tables](about_Hash_Tables.md)
* [about_operators](about_Operators.md)
* [about_variables](about_Variables.md)
* [Get-Date](xref:Microsoft.PowerShell.Utility.Get-Date)
* [New-TimeSpan](xref:Microsoft.PowerShell.Utility.New-TimeSpan)
- [about_arrays](about_Arrays.md)
- [about_assignment_operators](about_Assignment_Operators.md)
- [about_comparison_operators](about_Comparison_Operators.md)
- [about_hash_tables](about_Hash_Tables.md)
- [about_operators](about_Operators.md)
- [about_variables](about_Variables.md)
- [Get-Date](xref:Microsoft.PowerShell.Utility.Get-Date)
- [New-TimeSpan](xref:Microsoft.PowerShell.Utility.New-TimeSpan)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
keywords: powershell,cmdlet
Locale: en-US
ms.date: 09/14/2020
ms.date: 10/08/2020
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_operator_precedence?view=powershell-7&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about_Operator_Precedence
Expand Down Expand Up @@ -73,7 +73,7 @@ order:

| OPERATOR | REFERENCE |
| --------------------------------------- | ------------------------------ |
| `-band -bnot -bor -bxor` | [about_Arithmetic_Operators][] |
| `-band -bnot -bor -bxor -shr -shl` | [about_Arithmetic_Operators][] |
| `-and -or -xor` | [about_Logical_Operators][] |

The following items are not true operators. They are part of PowerShell's
Expand Down
Loading

0 comments on commit 6cffcfa

Please sign in to comment.