Skip to content

Commit 8c639c2

Browse files
committed
main
1 parent 56a3052 commit 8c639c2

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

docs/.vitepress/config.mts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ const vitepressConfig = defineConfig({
1717
markdown: {
1818
lineNumbers: true,
1919
theme: {
20-
light: await themeService.getTheme('Eva Light'),
21-
dark: await themeService.getTheme('Eva Dark'),
20+
// light: await themeService.getTheme('Eva Light'),
21+
// dark: await themeService.getTheme('Eva Dark'),
22+
light: 'light-plus',
23+
dark: 'dark-plus',
2224
},
2325
codeTransformers: [transformerTwoslash()],
2426
},

docs/document/Modern CSharp/docs/CSharp 5.0/`Task` based asynchronous programming.md

Whitespace-only changes.

docs/document/Modern CSharp/docs/CSharp 6.0/String interpolation.md

Whitespace-only changes.

docs/document/Modern CSharp/docs/Attribute/Attribute Targets.md renamed to docs/document/Modern CSharp/docs/Understanding Attributes.md

File renamed without changes.

docs/document/Modern CSharp/docs/Understanding Bit Operation.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,17 @@ Console.WriteLine($"{nameof(after),6}: {after:B8}");
3636
> Left & Right Shifting supports only `int`, `uint`, `long`, `ulong`. If you perform shifting on other integer types, the leftoperand is converted as `int`
3737
3838
> [!NOTE]
39-
> If shift count exceeds the bit width or is even negative, the count is determined by
39+
> If shift count exceeds the bit width or it's a negative integer, the count is determined by
4040
> - if leftoperand is `int` or `uint`: `count = count & 0b_1_1111`
4141
> - if leftoperand is `long` or `ulong`: `count = count & 0b_11_1111`
4242
4343
> [!NOTE]
44-
> Left shifting might discard sign of the number when it's signed
44+
> Left shifting might discard sign of the number when shift count is greater than 0
4545
>```cs
4646
>int foo = -0b_0001_0001_0001_0001_0001_0001_0001_0001_01;
4747
>Console.WriteLine(foo.ToString("B32"));
4848
>Console.WriteLine((foo << 1).ToString("B32"));
4949
>Console.WriteLine(int.IsPositive(foo << 1));
50-
5150
>// 10111011101110111011101110111011
5251
>// 01110111011101110111011101110110
5352
>// True
@@ -134,17 +133,17 @@ The mask can refer to a integer represented as binary, a sequence of integers or
134133

135134
### Is Bit Set
136135

137-
A common usage of mask is check whether specific bit **is set**
136+
A common usage of mask is checking whether certain bit **is set**
138137

139-
- when a bit is `1` meaning that it **is set**
140-
- when a bit is `0` meaning that it **is cleared**
138+
- a bit **is set** when its value is `1`
139+
- a bit **is cleared** when its value is `0`
141140

142141
A mask is a predefined number with special layout designated to solve specific problem.
143142
The following example shows how a mask is generated for the purpose.
144143

145144
`1` is shifted left to the position we would like to compare, and a bitwise AND is performed.
146145
Only the position matters since other bits are all `0` in the mask.
147-
So only when the bit on the position is set can the operation returns non-zero value.
146+
So only when the bit on the position is set can the operation return non-zero value.
148147

149148
```cs
150149
uint number = 0b_0101;
@@ -158,7 +157,7 @@ Since each enum member has **only one bit set**, the union in the following exam
158157
And in fact the operation `(union & flag)` should be equal to the flag itself.
159158

160159
> [!WARNING]
161-
> You have to make sure the enum member ot integer to be checked is a valid member or it may evaluate to unexpected value.
160+
> You have to make sure the enum member or integer to be checked is a valid member or it may evaluate to unexpected value.
162161
163162
```cs
164163
Foo foo = Foo.Bar | Foo.Qux;

0 commit comments

Comments
 (0)