Skip to content

IntegerEx ​

Kind: Static class

Namespace: CrowdControl.Common

Public Static Functions

int

CountDigits(int number)

int

CountDigits(int number, int base)

Half

SwapBytes(Half x)

short

SwapBytes(short x)

ushort

SwapBytes(ushort x)

float

SwapBytes(float x)

int

SwapBytes(int x)

uint

SwapBytes(uint x)

double

SwapBytes(double x)

long

SwapBytes(long x)

ulong

SwapBytes(ulong x)

long?

NullIfZero(byte value)

sbyte?

NullIfZero(sbyte value)

ushort?

NullIfZero(ushort value)

short?

NullIfZero(short value)

uint?

NullIfZero(uint value)

int?

NullIfZero(int value)

ulong?

NullIfZero(ulong value)

long?

NullIfZero(long value)

Half?

NullIfZero(Half value)

float?

NullIfZero(float value)

double?

NullIfZero(double value)

decimal?

NullIfZero(decimal value)

object

ToStructure(int value, Type type)

object

ToStructure(uint value, Type type)

object

ToStructure(long value, Type type)

object

ToStructure(ulong value, Type type)

T

ToStructure<T>(int value)

T

ToStructure<T>(uint value)

T

ToStructure<T>(long value)

T

ToStructure<T>(ulong value)

ulong[]

ToULongArray(long[] input)

byte[]

GetBytesBE(int value)

byte[]

GetBytesBE(uint value)

byte[]

GetBytes(uint val)

ReadOnlySpan

AsSpan(byte ref value)

ReadOnlySpan

AsSpan(sbyte ref value)

ReadOnlySpan

AsSpan(ushort ref value)

ReadOnlySpan

AsSpan(short ref value)

ReadOnlySpan

AsSpan(uint ref value)

ReadOnlySpan

AsSpan(int ref value)

ReadOnlySpan

AsSpan(ulong ref value)

ReadOnlySpan

AsSpan(long ref value)

ReadOnlySpan

AsSpan(Half ref value)

ReadOnlySpan

AsSpan(float ref value)

ReadOnlySpan

AsSpan(double ref value)

ReadOnlySpan

AsSpan(decimal ref value)

string

ToPaddedHexDigits(long value)

string

ToPaddedHexDigits(ulong value)

int

Ring(int value, int modulus)

int

Ring(int value, int minimum, int maximum)

long

Ring(long value, long modulus)

long

Ring(long value, long minimum, long maximum)

int

AddClamped(int value, int addend)

int

AddClamped(int value, int addend, int minValue, int maxValue)

float

AddClamped(float value, float addend, float minValue = 0, float maxValue = 1)

byte

Clamp(byte value, byte min, byte max)

sbyte

Clamp(sbyte value, sbyte min, sbyte max)

ushort

Clamp(ushort value, ushort min, ushort max)

short

Clamp(short value, short min, short max)

uint

Clamp(uint value, uint min, uint max)

int

Clamp(int value, int min, int max)

ulong

Clamp(ulong value, ulong min, ulong max)

long

Clamp(long value, long min, long max)

Half

Clamp(Half value, Half min, Half max)

float

Clamp(float value, float min, float max)

double

Clamp(double value, double min, double max)

decimal

Clamp(decimal value, decimal min, decimal max)

Half

ReinterpretAsHalf(short value)

Half

ReinterpretAsHalf(ushort value)

int

ReinterpretAsInt16(Half value)

uint

ReinterpretAsUInt16(Half value)

float

ReinterpretAsFloat(int value)

float

ReinterpretAsFloat(uint value)

int

ReinterpretAsInt32(float value)

uint

ReinterpretAsUInt32(float value)

double

ReinterpretAsDouble(long value)

double

ReinterpretAsDouble(ulong value)

long

ReinterpretAsInt64(double value)

ulong

ReinterpretAsUInt64(double value)

decimal

ReinterpretAsDecimal(long value)

decimal

ReinterpretAsDecimal(ulong value)

long

ReinterpretAsInt64(decimal value)

ulong

ReinterpretAsUInt64(decimal value)

int

HammingWeight(byte value)

int

HammingWeight(sbyte value)

int

HammingWeight(ushort value)

int

HammingWeight(short value)

int

HammingWeight(uint value)

int

HammingWeight(int value)

int

HammingWeight(ulong value)

int

HammingWeight(long value)