This code example uses an overload of this overloaded method that is different from the specific overload that this topic describes. To extend the example to this topic, substitute the elements of the source sequence with elements of the appropriate numerical type.

' Create a list of Single values. Dim numbers AsNew List(Of Single)(NewSingle() _
{43.68F, 1.25F, 583.7F, 6.5F})
' Get the sum of values in the list. DimsumAsSingle = numbers.Sum()
' Display the output.
MsgBox("The sum of the numbers is " & sum)
' This code produces the following output: ' ' The sum of the numbers is 635.13