Numerinus.Core
1.0.5
Prefix Reserved
See the version list below for details.
dotnet add package Numerinus.Core --version 1.0.5
NuGet\Install-Package Numerinus.Core -Version 1.0.5
<PackageReference Include="Numerinus.Core" Version="1.0.5" />
<PackageVersion Include="Numerinus.Core" Version="1.0.5" />
<PackageReference Include="Numerinus.Core" />
paket add Numerinus.Core --version 1.0.5
#r "nuget: Numerinus.Core, 1.0.5"
#:package Numerinus.Core@1.0.5
#addin nuget:?package=Numerinus.Core&version=1.0.5
#tool nuget:?package=Numerinus.Core&version=1.0.5
Numerinus.Core ๐งฎ
The foundational engine for the Numerinus mathematical suite. This package provides the core interfaces, high-precision constants, and base numerical types used across all Numerinus modules.
Features
- Generic Math Infrastructure โ
IArithmetic<T>interface for building type-safe, generic numerical algorithms. - Advanced Numerics โ Built-in
ComplexNumberandScalartypes ready to use out of the box. - High Precision โ
Accuracyutility for reliable floating-point epsilon comparisons. - Mathematical Constants โ High-precision values for ฯ, e, and ฯ available globally.
Installation
dotnet add package Numerinus.Core
using Numerinus.Core.Numerics;
var c1 = new ComplexNumber(10, 5);
var c2 = new ComplexNumber(2, 3);
var sum = ComplexNumber.Add(c1, c2);
// 12 + 8i var diff = ComplexNumber.Subtract(c1, c2); // 8 + 2i
var product = ComplexNumber.Multiply(c1, c2); // 5 + 40i var quotient = ComplexNumber.Divide(c1, c2); // 2.846... + (-0.769...)i
Console.WriteLine(sum); //
12 + 8i Console.WriteLine(c1.IsZero()); // False
Scalar
using Numerinus.Core.Numerics; Scalar a = 6.0; // implicit conversion from double Scalar b = 2.0; var result = Scalar.Multiply(a, b); double value = result; // implicit conversion back to double โ 12.0 Console.WriteLine(result); // 12 Console.WriteLine(Scalar.Zero); // 0 Console.WriteLine(Scalar.One); // 1
Accuracy
using Numerinus.Core.Precision; // Direct equality is unreliable for floating-point bool wrong = (0.1 + 0.2 == 0.3); // False โ bool correct = Accuracy.AreEqual(0.1 + 0.2, 0.3); // True โ // High precision comparison bool precise = Accuracy.AreEqual(a, b, Accuracy.HighPrecisionEpsilon);
Constants
using Numerinus.Core.Constants; double circumference = 2 * NumerinusConstants.Pi * radius; double growth = Math.Pow(NumerinusConstants.E, x); double spiral = NumerinusConstants.GoldenRatio * n;
API Reference
IArithmetic<T> โ Numerinus.Core.Interfaces
The central contract every numeric type in the Numerinus suite implements. public interface IArithmetic<T> where T : IArithmetic<T>
| Member | Kind | Description |
|---|---|---|
Add(T left, T right) |
Static method | Returns left + right |
Subtract(T left, T right) |
Static method | Returns left - right |
Multiply(T left, T right) |
Static method | Returns left ร right |
Divide(T left, T right) |
Static method | Returns left รท right |
Zero |
Static property | Additive identity |
One |
Static property | Multiplicative identity |
IsZero(double epsilon) |
Instance method | Precision-aware zero check (default ฮต = 1e-15) |
ComplexNumber โ Numerinus.Core.Numerics
Immutable class representing a complex number of the form a + bi.
| Member | Type | Description |
|---|---|---|
Real |
double |
The real component a |
Imaginary |
double |
The imaginary component b |
Zero |
ComplexNumber |
0 + 0i |
One |
ComplexNumber |
1 + 0i |
IsZero(epsilon) |
bool |
True if both components are within epsilon of zero |
ToString() |
string |
Returns "a + bi" |
All arithmetic operations return a new instance โ
ComplexNumberis fully immutable.
Scalar โ Numerinus.Core.Numerics
Immutable readonly struct wrapping a double. Supports implicit conversion to and from double.
| Member | Type | Description |
|---|---|---|
Value |
double |
The underlying value |
Zero |
Scalar |
Scalar(0) |
One |
Scalar |
Scalar(1) |
implicit operator Scalar(double) |
โ | Allows Scalar s = 5.0 |
implicit operator double(Scalar) |
โ | Allows double d = s |
Accuracy โ Numerinus.Core.Precision
| Member | Value | Description |
|---|---|---|
StandardEpsilon |
1e-15 |
Default precision threshold |
HighPrecisionEpsilon |
1e-18 |
High-precision threshold |
AreEqual(a, b, epsilon) |
โ | Returns true if \|a โ b\| < epsilon |
NumerinusConstants โ Numerinus.Core.Constants
| Constant | Value | Description |
|---|---|---|
Pi |
3.14159265358979323846 |
ฯ |
E |
2.71828182845904523536 |
Euler's number |
GoldenRatio |
1.61803398874989484820 |
ฯ (phi) |
Writing Generic Algorithms
IArithmetic<T> enables fully generic numerical algorithms that work across any compatible type:
using Numerinus.Core.Interfaces; static T Sum<T>(IEnumerable<T> items) where T : IArithmetic<T> { T result = T.Zero; foreach (var item in items) result = T.Add(result, item); return result; } // Works with ComplexNumber var complexSum = Sum(new[] { new ComplexNumber(1, 2), new ComplexNumber(3, 4) }); // โ 4 + 6i // Works with Scalar Scalar scalarSum = Sum(new Scalar[] { 1.0, 2.0, 3.0 }); // โ 6
Related Modules
| Package | Description |
|---|---|
Numerinus.Algebra |
Matrix operations and linear algebra |
Numerinus.Geometry |
Geometric types and transformations |
Numerinus.Statistics |
Statistical functions and distributions |
Support & Maintenance
Numerinus is an actively maintained suite of .NET libraries. To ensure that updates, bug fixes, and new performance optimizations continue to flow, consider supporting the project:
Sponsor on GitHub: Your support helps me dedicate more time to research, benchmarking, and shipping regular updates to the Numerinus ecosystem.
Feature Requests: Sponsors get priority visibility when suggesting new mathematical utilities or architectural improvements.
Keep it Alive: By sponsoring, you are investing in the long-term stability of these tools for the entire .NET community.
Stay Connected: For updates on the roadmap or to discuss the project, connect with me on LinkedIn.
License
Copyright (c) 2026 Sunil Chaware. Licensed under the MIT License. https://opensource.org/licenses/MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Numerinus.Core:
| Package | Downloads |
|---|---|
|
Numerinus.Algebra
Linear algebra module for the Numerinus mathematical suite. Provides a generic Matrix type built on Numerinus.Core. |
|
|
Numerinus.UnitConversion
Unit conversion module for the Numerinus mathematical suite. Provides conversion between physical units built on Numerinus.Core. |
|
|
Numerinus.Geometry
Geometry module for the Numerinus mathematical suite. Provides geometric types and transformations built on Numerinus.Core. |
|
|
Numerinus.Finance
Financial calculations module for the Numerinus mathematical suite. Provides interest, loan, depreciation, and investment calculators. |
|
|
Numerinus.Electrical
Electrical engineering calculations module for the Numerinus mathematical suite. Provides Ohm's law, power, circuit, and AC circuit calculators. |
GitHub repositories
This package is not used by any popular GitHub repositories.