ListExtensions.Sum

Extension Method in ListExtensions

Declaration

public static int Sum(this List<int> list)

Description

Calculates the sum of all items in the list.

Parameters

listThe list to sum.

Returns

intThe sum of all items in the list.

Overload

Declaration

public static float Sum(this List<float> list)

Description

Calculates the sum of all items in the list.

Parameters

listThe list to sum.

Returns

floatThe sum of all items in the list.

Overload

Declaration

public static double Sum(this List<double> list)

Description

Calculates the sum of all items in the list.

Parameters

listThe list to sum.

Returns

doubleThe sum of all items in the list.