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

out of bounds check too strict #2

Open
joasiee opened this issue Sep 10, 2022 · 1 comment
Open

out of bounds check too strict #2

joasiee opened this issue Sep 10, 2022 · 1 comment

Comments

@joasiee
Copy link

joasiee commented Sep 10, 2022

Shouldnt the out of bounds check be inclusive of the maximum indices?

So

if x0 >= 0 and y0 >= 0 and z0 >= 0 and x1 <= X and y1 <= Y and z1 <= Z:

instead of

if x0 >= 0 and y0 >= 0 and z0 >= 0 and x1 < X and y1 < Y and z1 < Z

?

@BigEmperor26
Copy link

No.

In an array with N elements they are indexed from 0 to N-1.

So it is correct to have boundary >=0 and <N

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

2 participants