On Wednesday, 30 October 2013 at 18:56:42 UTC, Zeke wrote:
On Wednesday, 30 October 2013 at 14:17:22 UTC, qznc wrote:
Why do you want to find the exact prime first? Just check
against sqrt(num) in the loop.
auto upper = cast(ulong)sqrt(cast(double)num)) + 1;
foreach(ulong prime; primes) {
if
On Wednesday, 30 October 2013 at 06:10:59 UTC, Ali Çehreli wrote:
On 10/29/2013 11:04 PM, Zeke wrote:
lowerBound and friends are related:
http://dlang.org/phobos/std_range.html#.lowerBound
Ali
lowerBound returns a range with the last value being the sqrt, so
I can't directly iterate over
On Wednesday, 30 October 2013 at 14:17:22 UTC, qznc wrote:
Why do you want to find the exact prime first? Just check
against sqrt(num) in the loop.
auto upper = cast(ulong)sqrt(cast(double)num)) + 1;
foreach(ulong prime; primes) {
if (prime > upper) return true;
if (num % prime == 0) return
On Wednesday, 30 October 2013 at 06:04:36 UTC, Zeke wrote:
Hello, I'm on day 2 of learning D. I've learned C, C++, Java,
Python, Ruby in University, but I wanted to broaden my palette
by picking up D.
This project is a basic implementation of Project Euler problem
10. I build an array of prim
On 10/29/2013 11:04 PM, Zeke wrote:
lowerBound and friends are related:
http://dlang.org/phobos/std_range.html#.lowerBound
Ali
Hello, I'm on day 2 of learning D. I've learned C, C++, Java,
Python, Ruby in University, but I wanted to broaden my palette by
picking up D.
This project is a basic implementation of Project Euler problem
10. I build an array of primes, and for each new test number I
check if the test is div