Skip to content

Latest commit

 

History

History

README.md

Unlicense NuGet Version and Downloads count Actions Status

Numbers for C#

LinksPlatform's Platform.Numbers Class Library.

Namespace: Platform.Numbers

NuGet package: Platform.Numbers

Overview

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.

Installation

dotnet add package Platform.Numbers

Usage

using 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); // 0xFF

PDF file with code for e-readers.

Depend on

Dependent libraries

License

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.