From: James Alan Preiss <jamesalanpreiss@gmail.com>
Date: Thu, 14 Nov 2019 19:58:32 +0000 (-0800)
Subject: symmetry in vadd4
X-Git-Url: https://git.owens.tech/dummy.html/dummy.html/git?a=commitdiff_plain;h=1540acce4df3dbc9d580798de722f743258c07dc;p=forks%2Fcmath3d.git

symmetry in vadd4
---

diff --git a/math3d.h b/math3d.h
index ef6bd94..465f7f5 100644
--- a/math3d.h
+++ b/math3d.h
@@ -227,7 +227,7 @@ static inline struct vec vadd3(struct vec a, struct vec b, struct vec c) {
 // add 4 vectors.
 static inline struct vec vadd4(struct vec a, struct vec b, struct vec c, struct vec d) {
 	// TODO: make sure it compiles to optimal code
-	return vadd(vadd(vadd(a, b), c), d);
+	return vadd(vadd(a, b), vadd(c, d));
 }
 // subtract b and c from a.
 static inline struct vec vsub2(struct vec a, struct vec b, struct vec c) {