Table of Contents

Class EnumerableProducts

Namespace
Garyon.Extensions
Assembly
Garyon.dll

Contains extensions for calculating the product of a collection.

public static class EnumerableProducts
Inheritance
EnumerableProducts
Inherited Members

Methods

Product(IEnumerable<int>)

Calculates the product of a collection of int values.

public static int Product(this IEnumerable<int> source)

Parameters

source IEnumerable<int>

The collection of values whose product to calculate.

Returns

int

The product of all the int values.

Remarks

Be wary of potential overflows. Consider using the ProductInt64(IEnumerable<int>) method, if appropriate.

Product(IEnumerable<long>)

Calculates the product of a collection of long values.

public static long Product(this IEnumerable<long> source)

Parameters

source IEnumerable<long>

The collection of values whose product to calculate.

Returns

long

The product of all the long values.

Product(IEnumerable<uint>)

Calculates the product of a collection of uint values.

public static uint Product(this IEnumerable<uint> source)

Parameters

source IEnumerable<uint>

The collection of values whose product to calculate.

Returns

uint

The product of all the uint values.

Remarks

Be wary of potential overflows. Consider using the ProductUInt64(IEnumerable<uint>) method, if appropriate.

Product(IEnumerable<ulong>)

Calculates the product of a collection of ulong values.

public static ulong Product(this IEnumerable<ulong> source)

Parameters

source IEnumerable<ulong>

The collection of values whose product to calculate.

Returns

ulong

The product of all the ulong values.

ProductInt64(IEnumerable<int>)

Calculates the product of a collection of int values.

public static long ProductInt64(this IEnumerable<int> source)

Parameters

source IEnumerable<int>

The collection of values whose product to calculate.

Returns

long

The product of all the int values, as a long.

ProductUInt64(IEnumerable<int>)

Calculates the product of a collection of int values.

public static ulong ProductUInt64(this IEnumerable<int> source)

Parameters

source IEnumerable<int>

The collection of values whose product to calculate.

Returns

ulong

The product of all the int values, as a ulong.

ProductUInt64(IEnumerable<uint>)

Calculates the product of a collection of uint values.

public static ulong ProductUInt64(this IEnumerable<uint> source)

Parameters

source IEnumerable<uint>

The collection of values whose product to calculate.

Returns

ulong

The product of all the uint values, as a ulong.