Skip to content

Commit f002e38

Browse files
sbryngelsonclaude
andcommitted
Fix 2D simplex noise using mod(i,255) instead of iand(i,255)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ab89856 commit f002e38

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pre_process/m_simplex_noise.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ contains
198198
x2 = x0 - 1._wp + 2._wp*G2
199199
y2 = y0 - 1._wp + 2._wp*G2
200200

201-
ii = mod(i, 255)
202-
jj = mod(j, 255)
201+
ii = iand(i, 255)
202+
jj = iand(j, 255)
203203

204204
gi0 = mod(p_vec(ii + p_vec(jj)), 10) + 1
205205
gi1 = mod(p_vec(ii + i1 + p_vec(jj + j1)), 10) + 1

0 commit comments

Comments
 (0)