Table of Contents

Struct IntegerFixedPartition

Namespace
LfrlAnvil.Numerics
Assembly
LfrlAnvil.Core.dll

A lightweight representation of an enumerable partition of an ulong into specified number of parts.

public readonly struct IntegerFixedPartition : IReadOnlyCollection<ulong>, IEnumerable<ulong>, IEnumerable
Implements
Inherited Members
Extension Methods

Constructors

IntegerFixedPartition(ulong, int)

Creates a new IntegerFixedPartition instance.

public IntegerFixedPartition(ulong value, int partCount)

Parameters

value ulong

Value to partition.

partCount int

Number of parts.

Exceptions

ArgumentOutOfRangeException

When partCount is less than 0.

Properties

Count

Number of parts.

public int Count { get; }

Property Value

int

Quotient

Base value for each part.

public ulong Quotient { get; }

Property Value

ulong

Remainder

An auxiliary integer division remainder used for filling out irregularities.

public ulong Remainder { get; }

Property Value

ulong

Value

Value to partition.

public ulong Value { get; }

Property Value

ulong

Methods

GetEnumerator()

Creates a new IntegerFixedPartition.Enumerator instance for this partition.

[Pure]
public IntegerFixedPartition.Enumerator GetEnumerator()

Returns

IntegerFixedPartition.Enumerator

New IntegerFixedPartition.Enumerator instance.

ToString()

Returns a string representation of this IntegerFixedPartition instance.

[Pure]
public override string ToString()

Returns

string

String representation.