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

nextPrime fails for 3 #4

Closed
NodeGuy opened this issue Sep 12, 2014 · 2 comments
Closed

nextPrime fails for 3 #4

NodeGuy opened this issue Sep 12, 2014 · 2 comments
Assignees
Labels

Comments

@NodeGuy
Copy link

NodeGuy commented Sep 12, 2014

nextPrime x First prime after x

> require('number-crunch').nextPrime(3)
[ 3 ]

I expect nextPrime(3) to return 5.

@vukicevic vukicevic added the bug label Sep 12, 2014
@vukicevic vukicevic self-assigned this Sep 12, 2014
@vukicevic
Copy link
Owner

At the moment nextPrime returns the input if it is prime. It was designed that way, but the naming is not appropriate for its purpose.

There will be a fix for nextPrime, and possibly a new function findPrime to replicate the current behavior.

@vukicevic
Copy link
Owner

Fixed in version 1.0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants