Example in the overview

Simen kjaeraas simen.kjaras at gmail.com
Fri May 14 17:37:42 PDT 2010


Walter Bright <newshound1 at digitalmars.com> wrote:

> bearophile wrote:
>> Walter Bright:
>>> Are you sure? What's the mistake in the code?
>>  This is the code in the Overview, it prints 1899:
>> http://codepad.org/lzRtggEL
>>  This is the code I have suggested in bugzilla, it prints 1027:
>> http://ideone.com/D9ZqQ
>>  Wolfram Alpha says they are 1027 (I have left out the last number  
>> because Alpha uses a closed interval)
>> http://www.wolframalpha.com/input/?i=primes+in+2+..+8190
>
>
> It's been printing 1899 primes since the 80's. Just for fun, google  
> [sieve of eratosthenes 1899 primes]

I wonder if that has to with there being 1899 primes in 3..16384.
http://www.wolframalpha.com/input/?i=primes+in+2+..+16384

An implementation of just that is what I found most of the time,
owing back to "A High-Level Language Benchmark" by Jim Gilbreath,
in BYTE Magazine, september 1981, pages 180-198.

Sadly, I cannot seem to find a version of the original article
online. Anyone know of one, that we may get to the bottom of this?

-- 
Simen


More information about the Digitalmars-d-learn mailing list