mirror of
https://codeberg.org/ziglings/exercises.git
synced 2024-12-26 01:20:30 +00:00
Compare commits
2 commits
75e5e53497
...
46e8fc0b61
Author | SHA1 | Date | |
---|---|---|---|
|
46e8fc0b61 | ||
|
8cce587d3b |
1 changed files with 13 additions and 0 deletions
13
patches/patches/109_vectors.patch
Normal file
13
patches/patches/109_vectors.patch
Normal 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;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue