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

Check for disallowed values #566

Open
Mananitade opened this issue Jun 24, 2024 · 1 comment
Open

Check for disallowed values #566

Mananitade opened this issue Jun 24, 2024 · 1 comment

Comments

@Mananitade
Copy link

// Check for division by zero

The condition "consensus_high <= consensus_low || alpha_low == 0 || alpha_high == 0" is to check for disallowed values, not for division by zero; moreover, division by zero is handled by saturation arithmetic operators.

@distributedstatemachine
Copy link
Contributor

distributedstatemachine commented Jun 24, 2024

Saturation maths would not prevent division by zero, as this check helps enforce the sanity checks . I would rather enforce more restrictions (i.e. program defensively) , as in the rare chance a 0 division does get past , the runtime will panic

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