Date: Thu, 26 Feb 1998 00:28:46 +0200 From: Anatoly Vorobey <mellon@pobox.com> To: hackers@FreeBSD.ORG Subject: Re: RE: New utilities: factor(1) and wid(1)? Message-ID: <19980226002846.05689@techunix.technion.ac.il> In-Reply-To: <01BD420C.2FCDD020.meuston@jmrodgers.com>; from Max Euston on Wed, Feb 25, 1998 at 04:41:11PM -0500 References: <01BD420C.2FCDD020.meuston@jmrodgers.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980226002846.05689>