LX4Cnh 1.1.0

Install-Package LX4Cnh -Version 1.1.0
dotnet add package LX4Cnh --version 1.1.0
<PackageReference Include="LX4Cnh" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LX4Cnh --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LX4Cnh, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install LX4Cnh as a Cake Addin
#addin nuget:?package=LX4Cnh&version=1.1.0

// Install LX4Cnh as a Cake Tool
#tool nuget:?package=LX4Cnh&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Algorithm of the high-speed multiplication of LARGE numbers; [0]

Read about LX4Cnh and related: 📑 https://www.reddit.com/r/x3F/comments/ovq368/highspeed_multiplication_of_large_numbers_fast/

Copyright (c) 2021  Denis Kuzmin <x-3F@outlook.com> github/3F

[ @ ☕ ]    License

MLnoCS vs LX4Cnh

Algorithm Maximum bits One multiplication
LX4Cnh 128+ × 128+ less than ~ 4.3 ns == 0.0000000043 sec
MLnoCS 128+ × 16 (*[1] 32) less than ~ 0.31 ns == 0.00000000031 sec
LX4Cnh optimized*[2] 128+ × 128+ *[2] less than ~ 0.86 ns == 0.00000000086 sec
  • *[1] - theoretically up to 128 x 32 with some correction.
  • *[2] - The actual calculation using LX4Cnh can be a bit optimized such for FNV1a-128 implementation (find it in my repo):

(1 ns == 0.000000001 sec)

Where is this used?

.NET implementation

128-bit numbers (full range, 128 × 128) NuGet package

LX4Cnh class provides several ways of setting and getting numbers by using uint, ulong, or bytes array. Just play with available Unit-Tests and Speed-Tests.

For example, using ulong (UInt64)
//   0x4BD4823ECC5D03EB19E07DB8FFD5DABE
// × 0x1D05906000069ABC40A30C07A70906D1

ulong high = LX4Cnh.Multiply
(
    0x4BD4823ECC5D03EB, 0x19E07DB8FFD5DABE,
    0x1D05906000069ABC, 0x40A30C07A70906D1,
    out ulong low
);
//          high            low
//     ________________|_______________
// = 0xACBBE8EAB60C77E249B25D708366091E

LX4Cnh core algorithm: 1.0
LX4Cnh for .NET: 1.1.0.2080+d76d867
Configuration: RCI
Platforms: net40;net472;netcoreapp2.1;net5;netstandard2.0

:: generated by a vsSolutionBuildEvent 1.14.1.34071


GetNuTool package manager: gnt /p:ngpackages="LX4Cnh/1.1.0"

  • .NETCoreApp 2.1

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • net5.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.0 103 7/26/2021