Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating Point Errors #18

Open
jit-zs opened this issue Oct 8, 2024 · 0 comments
Open

Floating Point Errors #18

jit-zs opened this issue Oct 8, 2024 · 0 comments

Comments

@jit-zs
Copy link

jit-zs commented Oct 8, 2024

MarchingSquaresAlgoTest.mp4

How do i fix these floating point errors in my script, is it possible that its the algorithm its self
double val = noise.noise2D_01(((i * MS_SPACING) * zoom) + (loaded_chunks[x].pos.x * zoom), ((j * MS_SPACING) * zoom) + (loaded_chunks[x].pos.y * zoom));
long ival = lround(val * 10); // Attempted mitigation using rounding
loaded_chunks[x].marching_squares[i][j].on = ival < 5; // The line causing the artifacting from fp errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant