yuck math

This commit is contained in:
Chris Adamson
2025-05-29 14:47:42 -05:00
parent 5db0fd575b
commit ff43f72b53
2 changed files with 7 additions and 1 deletions
@@ -16,6 +16,12 @@ public class MathUtil
return values.Sum();
}
public float ListSum(List<float> values)
{
// Sum the list starting with an initial value of 0
return values.Sum();
}
/// <summary>
/// Helper to create the cumulative sum of all list elements
/// ListCumSum([1, 2, 3, 4]) = [1, 3, 6, 10]
+1 -1
View File
@@ -10,7 +10,7 @@ public class MathUtilTests
[TestMethod]
public void ListSumTest()
{
var test = new List<double>
var test = new List<float>
{
1.1f,
2.1f,