From owner-freebsd-hackers Thu Feb 26 00:34:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA15346 for freebsd-hackers-outgoing; Thu, 26 Feb 1998 00:34:06 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.119.24.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA15336 for ; Thu, 26 Feb 1998 00:34:02 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [194.198.43.36]) by ns1.yes.no (8.8.7/8.8.7) with ESMTP id IAA04587; Thu, 26 Feb 1998 08:33:55 GMT Received: (from eivind@localhost) by bitbox.follo.net (8.8.6/8.8.6) id JAA24593; Thu, 26 Feb 1998 09:33:56 +0100 (MET) Message-ID: <19980226093356.27757@follo.net> Date: Thu, 26 Feb 1998 09:33:56 +0100 From: Eivind Eklund To: Anatoly Vorobey , hackers@FreeBSD.ORG Subject: Re: RE: New utilities: factor(1) and wid(1)? References: <01BD420C.2FCDD020.meuston@jmrodgers.com> <19980226002846.05689@techunix.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1i In-Reply-To: <19980226002846.05689@techunix.technion.ac.il>; from Anatoly Vorobey on Thu, Feb 26, 1998 at 12:28:46AM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Feb 26, 1998 at 12:28:46AM +0200, Anatoly Vorobey wrote: > It won't, at least not easily. It keeps a fixed precomputed table > of all primes up to 2^16 to do a simple sieve (in > /usr/src/games/primes/pr_tbl.c, also used by primes(1)); would be, > err, an interesting exercize to change that to a fixed precomputed > table of all primes up to 2^32 and watch the executable size go up, > up, up into tens of megabytes and beyond... > > It's time for to rewrite them both to use a more modern method > of factoring, I guess. It's been some 2500 years or so; ole' good > Eratosthenes could use some rest :) If somebody need a pure prime-generator, I've got one lying around somewhere. A full sieve, no pre-computed tables. Not top-notch for really large sieving, but OK for <32 bits at least (and could AFAIR scale beyond that; I think I did it as a 2-layer sieve to be able to scale to infinity. Still won't be the fastest method for factoring, though.) License negotiatable (BSD, public domain, GPL - anything you want, as long as it doesn't involve me paying anybody else money at a later date ;-) Eivind. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message