New numbers added for quick and easy reuse without struct creations.

This commit is contained in:
mlemanczyk committed 2025-12-28 00:12:39 +01:00
1 parent 6678f24887
commit 6603f65993
2 files changed
+17 -1

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
using System.Numerics;
namespace PerfectNumbers.Core
{
public static class BigIntegerNumbers
{
public static readonly BigInteger OneShiftedLeft63 = BigInteger.One << 63;
public static readonly BigInteger OneShiftedLeft256MinusOne = (BigInteger.One << 256) - BigInteger.One;
public static readonly BigInteger Two = (BigInteger)2;
public static readonly BigInteger UlongMaxValue = (BigInteger)ulong.MaxValue;
public static readonly BigInteger UlongMaxValuePlusOne = UlongMaxValue + BigInteger.One;
public static readonly BigInteger UInt128MaxValue = (BigInteger)UInt128.MaxValue;
public static readonly BigInteger UInt128MaxValuePlusOne = UInt128MaxValue + BigInteger.One;
}
}
+2 -1
View File
@@ -7,10 +7,11 @@ namespace PerfectNumbers.Core
public static readonly UInt128 Two = 2UL;
public static readonly UInt128 Three = 3UL;
public static readonly UInt128 Four = 4UL;
public static readonly UInt128 SixtyFour = 64UL;
public static readonly UInt128 MaxValueMinusOne = UInt128.MaxValue - UInt128.One;
public static readonly UInt128 OneHundredTwentySeven = 127UL;
public static readonly UInt128 OneShiftedLeft64 = UInt128.One << 64;
public static readonly UInt128 OneShiftedLeft64x2 = Two * OneShiftedLeft64;
public static readonly UInt128 SixtyFour = 64UL;
public static readonly GpuUInt128 TwoGpu = new(2UL);