Elektrine lite

← Feed

@bleuje@mathstodon.xyz

Post #2745120

2025-11-28 17:49 UTC

Sometimes to get modulo 1 and handle negative modulo I've been doing something like float p = (p+1234)%1; I thought it was a quick and fun way to do it in the context of creative coding. It turns out that this can be really bad for precision. So for that animation I was using double instead of float to get smooth movement but now I'm back to float with p = ((p%1)+1)%1;

Replies (0)

No replies.