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

Division by zero if ply_count = 0 #30

Open
NajdorfB opened this issue Oct 14, 2019 · 4 comments · May be fixed by #31
Open

Division by zero if ply_count = 0 #30

NajdorfB opened this issue Oct 14, 2019 · 4 comments · May be fixed by #31

Comments

@NajdorfB
Copy link

I experienced the case that ply_count can be zero, resulting in two separate division by zero errors. My quick fix was just to ensure that division by zero is not possible (see 9a311a0 )

Other solutions might be better or preferred.

@rpdelaney
Copy link
Collaborator

Thank you. I handled a similar problem like this: 6caa559

I tend to find that clearer since it's more obviously there for error state handling. What do you think?

@NajdorfB
Copy link
Author

Thank you. I handled a similar problem like this: 6caa559

I tend to find that clearer since it's more obviously there for error state handling. What do you think?

Yeah, it seems like a nice solution, definitive clearer.

@rpdelaney
Copy link
Collaborator

Cool. I will get around to it. Feel free to send a PR in the mean time.

By the way, did you observe this with zero-length PGN games or was it with 'normal' games?

@NajdorfB NajdorfB linked a pull request Oct 14, 2019 that will close this issue
@NajdorfB
Copy link
Author

I think it happened with zero-length PGN games, but I'm not sure.

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

Successfully merging a pull request may close this issue.

2 participants