Skip to content

Conversation

@0Zeta
Copy link
Contributor

@0Zeta 0Zeta commented Oct 3, 2019

There are no prime numbers smaller than 2, but 2 itself is prime.

There are no prime numbers smaller than 2, but 2 itself is prime.
Copy link

@Spikatrix Spikatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Although, it would be better if you move the sqrt to another variable so that it won't get evaluated in every iteration of the loop. Also, some spaces around the modulus operator would be nice: if (x % i == 0)

added spaces around the %-operator and assigned sqrt(x) to a variable
@0Zeta
Copy link
Contributor Author

0Zeta commented Oct 6, 2019

Looks good. Although, it would be better if you move the sqrt to another variable so that it won't get evaluated in every iteration of the loop. Also, some spaces around the modulus operator would be nice: if (x % i == 0)

Implemented your suggestions

@ashwek ashwek added the on hold label Oct 11, 2019
@ashwek ashwek removed the on hold label Oct 12, 2019
@ashwek ashwek merged commit 608c17b into TheAlgorithms:master Oct 12, 2019
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 this pull request may close these issues.

3 participants