Numbers for C#
LinksPlatform's Platform.Numbers Class Library.
Namespace: Platform.Numbers
NuGet package: Platform.Numbers
This library provides helper classes for numeric operations used throughout the LinksPlatform ecosystem:
Arithmetic/Arithmetic<T>— Generic arithmetic operations for unconstrained types.Bit/Bit<T>— Bit manipulation utilities for generic types.Math/Math<T>— Mathematical operations (e.g.Abs,Negate) for generic types.- Extension methods:
ArithmeticExtensions,BitExtensions,MathExtensions.
dotnet add package Platform.Numbersusing Platform.Numbers;
// Check if a bit is set
bool isSet = Bit.Get(0b1010, 3); // true
// Partial read from a number
long value = Bit.PartialRead(0xFF00, 8, 8); // 0xFFPDF file with code for e-readers.
This library is released to the public domain under the Unlicense.
The Unlicense is the most permissive license available — it places no restrictions whatsoever on users. You are free to copy, modify, publish, use, compile, sell, or distribute this software for any purpose, commercial or non-commercial, in any way you choose, with no conditions attached.
Unlike LGPL, which forces users to redistribute modifications under the same license and comply with specific obligations (linking restrictions, source disclosure for modifications), the Unlicense imposes no obligations at all. It is truly free as in freedom.