aboutsummaryrefslogtreecommitdiff
path: root/src/dolphin/MathUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dolphin/MathUtil.cpp')
-rw-r--r--src/dolphin/MathUtil.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/dolphin/MathUtil.cpp b/src/dolphin/MathUtil.cpp
new file mode 100644
index 0000000..70f2ede
--- /dev/null
+++ b/src/dolphin/MathUtil.cpp
@@ -0,0 +1,13 @@
+// Copyright 2008 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include "MathUtil.h"
+
+#include <numeric>
+
+// Calculate sum of a float list
+float MathFloatVectorSum(const std::vector<float>& Vec)
+{
+ return std::accumulate(Vec.begin(), Vec.end(), 0.0f);
+}