From owner-freebsd-hackers Wed Feb 25 14:29:12 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA11721 for freebsd-hackers-outgoing; Wed, 25 Feb 1998 14:29:12 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from techunix.technion.ac.il (mellon@techunix.technion.ac.il [132.68.1.28]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA11648 for ; Wed, 25 Feb 1998 14:28:56 -0800 (PST) (envelope-from mellon@techunix.technion.ac.il) Received: (from mellon@localhost) by techunix.technion.ac.il (8.8.7/8.8.5) id AAA22029; Thu, 26 Feb 1998 00:28:46 +0200 (IST) Message-ID: <19980226002846.05689@techunix.technion.ac.il> Date: Thu, 26 Feb 1998 00:28:46 +0200 From: Anatoly Vorobey To: hackers@FreeBSD.ORG Subject: Re: RE: New utilities: factor(1) and wid(1)? References: <01BD420C.2FCDD020.meuston@jmrodgers.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88 In-Reply-To: <01BD420C.2FCDD020.meuston@jmrodgers.com>; from Max Euston on Wed, Feb 25, 1998 at 04:41:11PM -0500 X-Disclaimer: I was young, I needed the money! Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG You, Max Euston, were spotted writing this on Wed, Feb 25, 1998 at 04:41:11PM -0500: > when I should have tried: > > $ man factor > > Didn't expect to find it in 'games' ??? - That is not in my PATH=. That's history for you, I guess. > It uses the 'primes' utility and is doing division (on 'long's) - I will do > some investigating to see if it is faster than my method and see if it will > scale to 'long long's. 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 :) Have a good one, Anatoly. P.S. What's the "politically correct" way to specify a long long in FreeBSD: 'long long'? 'int64_t'? 'quad_t'? -- Anatoly Vorobey, mellon@pobox.com http://pobox.com/~mellon/ "Angels can fly because they take themselves lightly" - G.K.Chesterton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message