BigNumbersNet 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package BigNumbersNet --version 1.0.2
                    
NuGet\Install-Package BigNumbersNet -Version 1.0.2
                    
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="BigNumbersNet" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BigNumbersNet" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="BigNumbersNet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BigNumbersNet --version 1.0.2
                    
#r "nuget: BigNumbersNet, 1.0.2"
                    
#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.
#:package BigNumbersNet@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BigNumbersNet&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=BigNumbersNet&version=1.0.2
                    
Install as a Cake Tool

BigNumbersNet

NuGet Version

A simple arbitrary-precision integer library for .NET, facilitating calculations for exceptionally large numbers.

Features

  • Immutable Data Type: Prevents unintended side-effects with thread-safe math operations.
  • Full Operator Overloading: Seamlessly write expressions using standard operators (+, -, *, /, %, < , >, ==).
  • Standard Math Functions: Out-of-the-box support for Abs, Pow, Max, Min, and GreatestCommonDivisor (GCD).
  • Targeting Modern Frameworks: Optimized for both .NET 8 and .NET 10.

Installation

Install via the NuGet Package Manager:

dotnet add package BigNumbersNet

Quick Start

using BigNumbersNet;

// Parsing large values
BigNumber val1 = BigNumber.Parse("987654321012345678901234567890");
BigNumber val2 = BigNumber.Parse("123456789012345678901234567890");

// Standard operations
BigNumber sum = val1 + val2;
BigNumber difference = val1 - val2;
BigNumber product = val1 * val2;
BigNumber quotient = val1 / val2;
BigNumber remainder = val1 % val2;

// Advanced Math
BigNumber gcd = BigNumber.GreatestCommonDivisor(val1, val2);
BigNumber raised = BigNumber.Pow(BigNumber.Parse("5"), 100);

Console.WriteLine($"Sum: {sum}");
Console.WriteLine($"GCD: {gcd}");

Performance & Design Note

The library stores decimal digits internally in base-10 byte arrays, reducing allocation overhead and memory mutations. While it is stable for basic mathematical assertions, it relies on schoolbook implementation algorithms. For cryptographically secure operations or heavy high-performance computations, we recommend reviewing performance against platform-standard System.Numerics.BigInteger.

License

This project is licensed under the GPL-3.0 license.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

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
1.1.1 126 6/25/2026
1.0.2 110 6/25/2026