CodeChops.GenericMath
3.3.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package CodeChops.GenericMath --version 3.3.1
NuGet\Install-Package CodeChops.GenericMath -Version 3.3.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CodeChops.GenericMath" Version="3.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CodeChops.GenericMath --version 3.3.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CodeChops.GenericMath, 3.3.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CodeChops.GenericMath as a Cake Addin #addin nuget:?package=CodeChops.GenericMath&version=3.3.1 // Install CodeChops.GenericMath as a Cake Tool #tool nuget:?package=CodeChops.GenericMath&version=3.3.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Generic math
Provides a way to perform generic math functions on the following numeric types: byte
, sbyte
, decimal
, double
, float
, int
, uint
, nint
, nuint
, long
, ulong
, short
, ushort
. The following operations are supported: add, subtract, multiply, divide, modulo, negate, plus, increment, decrement, leftShift, rightShift, onesComplement, and, or, xor.
Other features:
- Supports converting at runtime (when the type to convert to/from is not known at compile time).
- Contains a JSON converter which cleanly and correctly converts these numbers from and to JSON.
Note:
- This functionality can nowadays also be achieved by using the GenericMath functionality of .NET 7. C# 11 also has to be used because it makes use of static abstract members in interfaces the achieve its goal, which is introduced in C# 11. See: Microsoft - Generic math
- This code is adapted from: StackExchange - Generic Calculator and Generic Number
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- System.Text.Json (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
3.3.3 | 338 | 12/28/2022 | |
3.3.2 | 559 | 12/9/2022 | |
3.3.1 | 319 | 12/9/2022 | |
2.10.0 | 1,384 | 9/14/2022 | |
1.3.7 | 1,372 | 7/11/2022 | |
1.3.6 | 1,360 | 7/10/2022 | |
1.3.5 | 437 | 7/10/2022 | |
1.3.4 | 1,117 | 7/8/2022 | |
1.3.3 | 441 | 7/6/2022 | |
1.3.2 | 971 | 7/6/2022 | |
1.3.0 | 8,822 | 3/3/2022 | |
1.2.8 | 445 | 2/20/2022 | |
1.2.7 | 963 | 2/19/2022 | |
1.2.6 | 471 | 2/19/2022 | |
1.2.5 | 469 | 2/19/2022 |
Added README.md to package.