Compare commits

...

2 commits

Author SHA1 Message Date
bgthompson
46e8fc0b61 line ending format patch attempt 2024-11-07 13:42:53 +10:00
bgthompson
8cce587d3b added patch file for 109_vectors 2024-11-07 13:31:32 +10:00

View file

@ -0,0 +1,13 @@
--- exercises/109_vectors.zig 2024-11-03 11:17:00.928652000 +1000
+++ answers/109_vectors.zig 2024-11-07 13:11:23.838667200 +1000
@@ -121,8 +121,8 @@
const Vec4 = @Vector(4, f32);
fn calcMaxPairwiseDiffNew( a : Vec4, b : Vec4) f32 {
- const abs_diff_vec = ???;
- const max_diff = @reduce(???, abs_diff_vec);
+ const abs_diff_vec = @abs( a - b );
+ const max_diff = @reduce(.Max, abs_diff_vec);
return max_diff;
}