[Issue 4164] sieve Sample D Program -- need documentation for array representation
https://issues.dlang.org/show_bug.cgi?id=4164 Andrei Alexandrescu changed: What|Removed |Added Version|future |D2 --
[Issue 4164] sieve Sample D Program -- need documentation for array representation
https://issues.dlang.org/show_bug.cgi?id=4164 Andrej Mitrovic changed: What|Removed |Added Status|NEW |RESOLVED CC||andrej.mitrov...@gmail.com Resolution|--- |FIXED --
[Issue 4164] sieve Sample D Program -- need documentation for array representation
https://issues.dlang.org/show_bug.cgi?id=4164 --- Comment #5 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/24e526e966150baf2cf93b53caa2820e121795cd Issue 4164 - sieve Sample D Program -- need documentation for array representation https://github.com/D-Programming-Language/dlang.org/commit/253c45bb9d1e2f0338b437063f358571cd5e9bc3 Merge pull request #528 from Infiltrator/patch-5 Issue 4164 - sieve Sample D Program -- need documentation for array rep... --
[Issue 4164] sieve Sample D Program -- need documentation for array representation
https://d.puremagic.com/issues/show_bug.cgi?id=4164 Infiltrator changed: What|Removed |Added CC||lt.infiltra...@gmail.com --- Comment #4 from Infiltrator 2014-03-18 22:59:45 PDT --- https://github.com/D-Programming-Language/dlang.org/pull/528 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4164] sieve Sample D Program -- need documentation for array representation
http://d.puremagic.com/issues/show_bug.cgi?id=4164 --- Comment #3 from Walter Bright 2010-05-14 21:45:48 PDT --- Steven wrote in the n.g.: I think the issue is that the expectation is that array index x represents the number x. But it doesn't seem that way. the i + i + 3 is very odd indeed. If we consider each index, it means the first element represents 0 + 0 + 3 = 3; The second element represents 1 + 1 + 3 = 5; The third element represents 2 + 2 + 3 = 7; So it looks like the numbers represented by the array actually go from 3 to (8190 + 8190 + 3) or 16383. According to Wolfram Alpha, the number of primes in that list is 1899 http://www.wolframalpha.com/input/?i=primes+in+3+..+16383 A comment to explain the representation of the array may be good. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4164] sieve Sample D Program -- need documentation for array representation
http://d.puremagic.com/issues/show_bug.cgi?id=4164 Steven Schveighoffer changed: What|Removed |Added CC||schvei...@yahoo.com Summary|sieve Sample D Program |sieve Sample D Program -- ||need documentation for ||array representation --- Comment #2 from Steven Schveighoffer 2010-05-14 20:38:19 PDT --- The issue is there is no documentation. The array actually represents the values 3 to 16383 inclusive, with a stride of 2. i.e. index 0 represents the number 3, index 1 represents the number 5. This relationship can be seen in the prime = i + i + 3 line. With that in mind, the code is correct, it's just confusing :) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---