Skip to content

Commit af26e8c

Browse files
authored
Merge pull request #4 from webmaster442/next
Next update
2 parents fd72a11 + c3e71a1 commit af26e8c

File tree

3 files changed

+730
-32
lines changed

3 files changed

+730
-32
lines changed

cheatsheet.md

+158-17
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The .NET Logo is copyright of the .NET authors. - https://github.com/dotnet/bran
2121
## Changelog
2222

2323
* 2024.02.29 - Initial release
24+
* 2024.03.08 - Generic math interfaces extended & various small improvements
2425

2526
# Dotnet basic commands
2627

@@ -122,6 +123,22 @@ Globaly means that the tool is installed to the users profile, instead of the cu
122123

123124
More info: https://dotnet.microsoft.com/en-us/platform/upgrade-assistant
124125

126+
* **SlnGen**
127+
128+
SlnGen is a Visual Studio solution file generator. Visual Studio solutions generally do not scale well for large project trees. They are scoped views of a set of projects. Enterprise-level builds use custom logic like traversal to convey how they should be built by a hosted build environment. Maintaining Visual Studio solutions becomes hard because you have to keep them in sync with the other build logic. Instead, SlnGen reads the project references of a given project to create a Visual Studio solution on demand. For example, you can run it against a unit test project and be presented with a Visual Studio solution containing the unit test project and all of its project references.
129+
130+
Install with: `dotnet tool install --global Microsoft.VisualStudio.SlnGen.Tool --add-source https://api.nuget.org/v3/index.json --ignore-failed-sources`
131+
132+
More info: https://github.com/microsoft/slngen
133+
134+
* **Roslynator Cli**
135+
136+
Roslynator is a set of code analysis tools for C#, powered by Roslyn.
137+
138+
Install with: `dotnet tool install -g roslynator.dotnet.cli`
139+
140+
More info: https://josefpihrt.github.io/docs/roslynator/cli
141+
125142
# Project file XML settings
126143

127144
* Enable implicit usings:
@@ -172,26 +189,36 @@ Globaly means that the tool is installed to the users profile, instead of the cu
172189
</PropertyGroup>
173190
```
174191

192+
* Disable Source Link Source Revision including in Assembly info:
193+
194+
```xml
195+
<PropertyGroup>
196+
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
197+
</PropertyGroup>
198+
```
199+
175200
# Basic type system
176201

177202
## Numerical types
178203

179-
| Type | bytes | Bits | Minimum value | Maximum Value |
180-
| :-----: | :----: | :------: | :------------------------------------: | :-----------------------------------: |
181-
| byte | 1 | 8 | 0 | 255 |
182-
| sbyte | 1 | 8 | -127 | 127 |
183-
| short | 2 | 16 | -32 768 | 32 767 |
184-
| ushort | 2 | 16 | 0 | 65 535 |
185-
| int | 4 | 32 | -2 147 483 648 | 2 147 483 647 |
186-
| uint | 4 | 32 | 0 | 4 294 967 295 |
187-
| long | 8 | 64 | -9 223 372 036 854 775 808 | 9 223 372 036 854 775 807 |
188-
| ulong | 8 | 64 | 0 | 18 446 744 073 709 551 615 |
189-
| float | 4 | 32 | -3.4028235 x 10<sup>38</sup> | 3.4028235 x 10<sup>38</sup> |
190-
| double | 8 | 64 | -1.7976931348623157 x 10<sup>308</sup> | 1.7976931348623157 x 10<sup>308</sup> |
191-
| decimal | 16 | 128 | -7.92 x 10 <sup>28</sup> | 7.92 x 10 <sup>28</sup> |
192-
| Half | 2 | 16 | -65 504 | 65 504 |
193-
| nint | 4 or 8 | 32 or 64 | platform dependent signed integer | platform dependent signed integer |
194-
| nuint | 4 or 8 | 32 or 64 | platform dependent unsigned integer | platform dependent unsigned integer |
204+
| Type | bytes | Bits | Minimum value | Maximum Value |
205+
| :-----: | :----: | :------: | :--------------------------------------------------: | :-------------------------------------------------: |
206+
| byte | 1 | 8 | 0 | 255 |
207+
| sbyte | 1 | 8 | -127 | 127 |
208+
| short | 2 | 16 | -32 768 | 32 767 |
209+
| ushort | 2 | 16 | 0 | 65 535 |
210+
| int | 4 | 32 | -2 147 483 648 | 2 147 483 647 |
211+
| uint | 4 | 32 | 0 | 4 294 967 295 |
212+
| long | 8 | 64 | -9 223 372 036 854 775 808 | 9 223 372 036 854 775 807 |
213+
| ulong | 8 | 64 | 0 | 18 446 744 073 709 551 615 |
214+
| Int128 | 16 | 128 | -170 141 183 460 469 231 731 687 303 715 884 105 728 | 170 141 183 460 469 231 731 687 303 715 884 105 727 |
215+
| UInt128 | 16 | 128 | 0 | 340 282 366 920 938 463 463 374 607 431 768 211 455 |
216+
| nint | 4 or 8 | 32 or 64 | platform dependent signed integer | platform dependent signed integer |
217+
| nuint | 4 or 8 | 32 or 64 | platform dependent unsigned integer | platform dependent unsigned integer |
218+
| float | 4 | 32 | -3.4028235 x 10<sup>38</sup> | 3.4028235 x 10<sup>38</sup> |
219+
| double | 8 | 64 | -1.7976931348623157 x 10<sup>308</sup> | 1.7976931348623157 x 10<sup>308</sup> |
220+
| decimal | 16 | 128 | -7.92 x 10 <sup>28</sup> | 7.92 x 10 <sup>28</sup> |
221+
| Half | 2 | 16 | -65 504 | 65 504 |
195222

196223
Note: `nint` and `nuint` represent the platforms native integer type. For 32 bit systems this will be a 32 bit integer, so the limitations and properties of `int`
197224
or `uint` aplies. On 64 bit systems the limitations and properties of `long` and `ulong` applies.
@@ -217,6 +244,120 @@ Note: `nint` and `nuint` represent the platforms native integer type. For 32 bit
217244

218245
## Generic Math Interfaces
219246

247+
![Generic Math Interfaces](img/genericmath1.svg)
248+
249+
* `IComparable<T>`
250+
251+
Defines a generalized comparison method that a value type or class implements to create a type-specific comparison method for ordering or sorting its instances.
252+
253+
* `IConvertible`
254+
255+
Defines methods that convert the value of the implementing reference or value type to a common language runtime type that has an equivalent value.
256+
257+
* `IEquatable<T>`
258+
259+
Defines a generalized method that a value type or class implements to create a type-specific method for determining equality of instances.
260+
261+
* `IParsable<T>`
262+
263+
Defines a mechanism for parsing a string to a value.
264+
265+
* `ISpanParsable<T>`
266+
267+
Defines a mechanism for parsing a span of characters to a value.
268+
269+
* `IAdditionOperators<TSelf,TSelf,TSelf>`
270+
271+
Defines a mechanism for computing the sum of two values. Provides operators: `+`
272+
273+
* `IBitwiseOperators<TSelf,TSelf,TSelf>`
274+
275+
Defines a mechanism for performing bitwise operations over two values. Provides operators: `&`, `|`, `^`, `~`
276+
277+
* `IComparisonOperators<TSelf,TSelf,bool>`
278+
279+
Defines a mechanism for comparing two values to determine relative order. Provides operators: `>`, `>=`, `<`, `<=`
280+
281+
* `IDecrementOperators<T>`
282+
283+
Defines a mechanism for decrementing a given value. Provides operators: `--`
284+
285+
* `IDivisionOperators<TSelf,TSelf,TSelf>`
286+
287+
Defines a mechanism for computing the quotient of two values. Provides operators: `/`
288+
289+
* `IEqualityOperators<TSelf,TSelf,bool>`
290+
291+
Defines a mechanism for comparing two values to determine equality. Provides operators: `==`, `!=`
292+
293+
* `IIncrementOperators<T>`
294+
295+
Defines a mechanism for incrementing a given value. Provides operators: `++`
296+
297+
* `IModulusOperators<TSelf,TSelf,TSelf>`
298+
299+
Defines a mechanism for computing the modulus or remainder of two values. Provides operators: `%`
300+
301+
* `IMultiplyOperators<TSelf,TSelf,TSelf>`
302+
303+
Defines a mechanism for computing the product of two values. Provides operators: `*`
304+
305+
* `IShiftOperators<TSelf,int,TSelf>`
306+
307+
Defines a mechanism for shifting a value by another value. Provides operators: `<<`, `>>`, `<<<`
308+
309+
* `ISubtractionOperators<TSelf,TSelf,TSelf>`
310+
311+
Defines a mechanism for computing the difference of two values. Provides operators: `-`
312+
313+
* `IUnaryNegationOperators<TSelf,TSelf>`
314+
315+
Defines a mechanism for computing the unary negation of a value. Provides operators: `-`
316+
317+
* `IUnaryPlusOperators<TSelf,TSelf>`
318+
319+
Defines a mechanism for computing the unary plus of a value. Provides operators: `+`
320+
321+
* `IAdditiveIdentity<TSelf,TSelf>`
322+
323+
Defines a mechanism for getting the additive identity of a given type.
324+
325+
* `IMultiplicativeIdentity<TSelf,TSelf>`
326+
327+
Defines a mechanism for getting the multiplicative identity of a given type.
328+
329+
* `IMinMaxValue<T>`
330+
331+
Defines a mechanism for getting the minimum and maximum value of a type.
332+
333+
* `IExponentialFunctions<T>`
334+
335+
Defines support for exponential functions.
336+
337+
* `IFloatingPointConstants<T>`
338+
339+
Defines support for floating-point constants, like `E`, `Pi`, `Tau`
340+
341+
* `IHyperbolicFunctions<T>`
342+
343+
Defines support for hyperbolic functions.
344+
345+
* `ILogarithmicFunctions<T>`
346+
347+
Defines support for logarithmic functions.
348+
349+
* `IPowerFunctions<T>`
350+
351+
Defines support for power functions.
352+
353+
* `IRootFunctions<T>`
354+
355+
Defines support for root functions.
356+
357+
* `ITrigonometricFunctions<T>`
358+
359+
Defines support for trigonometric functions.
360+
220361
| Interfaces / Types | SByte, Int16, Int32, Int64 | Int128 | Byte, UInt16, UInt32, UInt64 | UInt128 | Half | Single, Double | Decimal | Complex | BigInteger |
221362
| :----------------------------------------: | :------------------------: | :----: | :--------------------------: | :-----: | :---: | :------------: | :-----: | :-----: | :--------: |
222363
| `INumberBase<T>` | √ | √ | √ | √ | √ | √ | √ | √ | √ |
@@ -248,7 +389,7 @@ Note: `nint` and `nuint` represent the platforms native integer type. For 32 bit
248389
| `IUnaryPlusOperators<TSelf,TSelf>` | √ | √ | √ | √ | √ | √ | √ | √ | √ |
249390
| `IAdditiveIdentity<TSelf,TSelf>` | √ | √ | √ | √ | √ | √ | √ | √ | √ |
250391
| `IMultiplicativeIdentity<TSelf,TSelf>` | √ | √ | √ | √ | √ | √ | √ | √ | √ |
251-
| `IMinMa√Value<T>` | √ | √ | √ | √ | √ | √ | √ | | |
392+
| `IMinMaxValue<T>` | √ | √ | √ | √ | √ | √ | √ | | |
252393
| `IExponentialFunctions<T>` | | | | | √ | √ | | | |
253394
| `IFloatingPointConstants<T>` | | | | | √ | √ | √ | | |
254395
| `IHyperbolicFunctions<T>` | | | | | √ | √ | | | |

0 commit comments

Comments
 (0)