From a924a02bc13f14ed16203517c7b0fd02fcb250f0 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 19 Feb 1998 18:37:58 +0000 Subject: [PATCH] Make the primes generation go to the true square root of parameter max. (Pointed out by jb@dilbert.apo.nmsu.edu (Jon Brinkmann) on usenet.) --- distrib/utils/sysinst/factor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distrib/utils/sysinst/factor.c b/distrib/utils/sysinst/factor.c index f005082fd361..6f431a85a84c 100644 --- a/distrib/utils/sysinst/factor.c +++ b/distrib/utils/sysinst/factor.c @@ -1,4 +1,4 @@ -/* $NetBSD: factor.c,v 1.4 1997/12/20 23:47:02 cjs Exp $ */ +/* $NetBSD: factor.c,v 1.5 1998/02/19 18:37:58 phil Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -63,7 +63,7 @@ static void build_primes (long max) primes[0] = 2; primes[1] = 3; - for (pc = primes[num_primes-1]; pc < 46345 && pc*pc < max; pc+=2) { + for (pc = primes[num_primes-1]; pc < 46345 && pc*pc <= max; pc+=2) { j = 0; rem = 1; while (j