summaryrefslogtreecommitdiff
path: root/vector.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'vector.hpp')
-rw-r--r--vector.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/vector.hpp b/vector.hpp
index f642816..04a1a97 100644
--- a/vector.hpp
+++ b/vector.hpp
@@ -10,7 +10,7 @@ template <class T, int D> Vector<T, D> diff(T L, Vector<T, D> v1, Vector<T, D> v
Vector<T, D> v;
for (unsigned i = 0; i < D; i++) {
- v(i) = std::abs(mod(v1(i), L) - mod(v2(i), L));
+ v(i) = mod(std::abs(v1(i) - v2(i)), L);
if (v(i) > L / 2) {
v(i) = L - v(i);
}