Deutsch English Français Italiano |
<87frpeqg66.fsf@nosuchdomain.example.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c Subject: Re: A very slow program Date: Wed, 02 Oct 2024 15:43:45 -0700 Organization: None to speak of Lines: 27 Message-ID: <87frpeqg66.fsf@nosuchdomain.example.com> References: <vc7nb0$7rl3$1@paganini.bofh.team> <vdjm2s$394jf$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 03 Oct 2024 00:43:46 +0200 (CEST) Injection-Info: dont-email.me; posting-host="e6fe990cb626ec78a67f7bed220ad565"; logging-data="3585066"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IsrqEcY31nKQqwQ0EG3hU" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:OSB8QB2tWcnDIMWk1anGrzPOqwk= sha1:fxEkRzlomwMN1uX0PR9CddOcIQc= Bytes: 2191 Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes: [...] > For ordinary users it's probably sufficient to use an existing > program; on Unix 'primes 1 1000000000' runs in about 8 seconds. > And it's checking 2^32 numbers in 50 seconds (including 'wc' > and creating output [suppressed by redirection]), generating > 50847534 primes. A simple prime test of some "arbitrary large" > number runs in no time, as does factorization of numbers with > the Unix'es 'factor' program. Just a simple command line call. > That existing 'primes' program also has some limit; the man page > documents a value of 4294967295, but no error message is created > for values up to around 1.8446744*10^19 on my system. On my system (Ubuntu 22.04.5 LTS, 64 bits), the primes(1) man page says: "The stop value must not be greater than 3825123056546413050." 4294967295 is of course 2**31-1. I don't know the significance of 3825123056546413050. The change was made by Debian, but the sources don't explicitly give a reason. Anyone who wants to look into it can see the patches here: https://salsa.debian.org/games-team/bsdgames -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */