NumeralSystems.Net 3.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package NumeralSystems.Net --version 3.0.0
                    
NuGet\Install-Package NumeralSystems.Net -Version 3.0.0
                    
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="NumeralSystems.Net" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NumeralSystems.Net" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NumeralSystems.Net" />
                    
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 NumeralSystems.Net --version 3.0.0
                    
#r "nuget: NumeralSystems.Net, 3.0.0"
                    
#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 NumeralSystems.Net@3.0.0
                    
#: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=NumeralSystems.Net&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NumeralSystems.Net&version=3.0.0
                    
Install as a Cake Tool

NumeralSystem

This library is inteded to simplify the creation/usage of numeral systems.

Usage

Creation of numeral system

To create a numeral system by It's construnctor you must define an identity of unique elements and a string separator.

public NumeralSystem(HashSet<string> identity, string separator = ";")

Otherwhise you can create a numeral system with the identity dimension by calling:

public static NumeralSystem Numeral.System.OfBase(int value, string separator = "")

Like so:

var binary = Numeral.System.OfBase(2);

Indexing a numeral

You can get a numeral from It's index (int or float):

var valueA = binary[12];
var valueB = binary[1.2f];

Parsing a string

You can parse a string to It's numeral representation with the StringParse method:

var valueC = binary.StringParse("1100");

Conversions

A numeral can be converted to:

  • An integer

    var a = valueA.Integer;

  • A double

    var b = valueB.Double;

  • A decimal

    var d = valueB.Double;

  • A string

    var c = valueC.ToString();

  • A number of another base

    var d = valueC.To(Numeral.System.OfBase(5));

Customizations

You can create your custom Numeral System by providing:

  • A custom string parser.

    By calling the setter of "Func<string, Numeral> StringParse" in the NumeralSystem class

  • The indexing mechanism.

    By calling the setter of "Func<int, bool, List<string>, List<string>> IntIndexer" in the NumeralSystem class

  • The string conversion mechanism.

    By calling the setter of "Func<(List<string> Integral, List<string> Fractional, bool IsPositive), string> StringConverter" in the NumeralSystem class

  • The negative simbol.

    By calling the setter of "string NegativeSign" in the NumeralSystem class

  • The CultureInfo (That provides the default symbols for negative and floats)

    By calling the setter of "CultureInfo CultureInfo" in the NumeralSystem class

  • The Float symbol.

    By calling the setter of "string FloatSign" in the NumeralSystem class

  • The Separator. (If the string representing the value is longer than 1 char)

    By calling the setter of "string Separator" in the NumeralSystem class

UnitTest

To test the functionalities you can use NumeralSystem.Net.NUnit

Test

To test the implementations you can use the UI project NumeralConverter that features a conversion from base to base.

Nuget

You can use the library here from Nuget.org

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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.  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 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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on NumeralSystems.Net:

Package Downloads
AnyBase.Net

Encode and decode text or bytes with any ordered alphabet.

NumeralSystems.Net.Json

Explicit System.Text.Json integration for exact NumeralSystems.Net values.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.3.0 360 8/1/2026
5.2.0 124 8/1/2026
5.1.0 121 7/31/2026
5.0.0 107 7/31/2026
4.8.1 94 7/31/2026
4.8.0 100 7/31/2026
4.7.0 102 7/31/2026
4.6.0 97 7/31/2026
4.5.2 106 7/30/2026
4.5.1 288 12/8/2024
4.5.0 177 12/8/2024
4.4.0.1 209 12/7/2024 4.4.0.1 is deprecated because it is no longer maintained.
4.4.0 204 12/7/2024 4.4.0 is deprecated because it is no longer maintained.
4.3.0 201 9/10/2024
3.0.0 603 4/18/2022
1.0.1 556 4/2/2022
1.0.0 418 1/7/2022
0.5.0 436 12/19/2021