git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13983 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2015-09-02 20:39:55 +00:00
parent 3f79c91279
commit 047be536bc
35 changed files with 236 additions and 104 deletions

View File

@ -369,7 +369,7 @@ int Atom::next_prime(int n)
if (nprime % 2 == 0) nprime++;
int root = static_cast<int> (sqrt(1.0*n)) + 2;
while (nprime <= MAXSMALLINT) {
while (nprime < MAXSMALLINT) {
for (factor = 3; factor < root; factor++)
if (nprime % factor == 0) break;
if (factor == root) return nprime;