We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/raywenderlich/swift-algorithm-club/tree/master/GCD The code fails (fatalError) in various valid scenarios, e.g. lcm(3, 4) --> should be 12.
guard (m & n) != 0 else { throw LCMError.divisionByZero }
This is not a division by zero check, nor is it a relevant check for this algorithm. Would recommend changing to e.g.
guard m > 0, n > 0 else { throw LCMError.nonPositiveNumbers } //Must be added to LCMError.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Brief Intro
https://github.com/raywenderlich/swift-algorithm-club/tree/master/GCD
The code fails (fatalError) in various valid scenarios, e.g. lcm(3, 4) --> should be 12.
More Details
This is not a division by zero check, nor is it a relevant check for this algorithm.
Would recommend changing to e.g.
The text was updated successfully, but these errors were encountered: