Click here to Skip to main content
15,907,905 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Questionparallel processing Pin
Tiju John11-Mar-10 23:31
Tiju John11-Mar-10 23:31 
AnswerRe: parallel processing Pin
Eddy Vluggen12-Mar-10 1:01
professionalEddy Vluggen12-Mar-10 1:01 
GeneralRe: parallel processing Pin
Tiju John12-Mar-10 3:16
Tiju John12-Mar-10 3:16 
AnswerRe: parallel processing Pin
Dave Kreskowiak12-Mar-10 2:00
mveDave Kreskowiak12-Mar-10 2:00 
GeneralRe: parallel processing Pin
Tiju John12-Mar-10 3:20
Tiju John12-Mar-10 3:20 
GeneralRe: parallel processing Pin
Dave Kreskowiak12-Mar-10 5:09
mveDave Kreskowiak12-Mar-10 5:09 
AnswerRe: parallel processing Pin
frito_burrito12-Mar-10 4:39
frito_burrito12-Mar-10 4:39 
GeneralRe: parallel processing Pin
harold aptroot12-Mar-10 5:15
harold aptroot12-Mar-10 5:15 
Why are you using doubles to calculate prime numbers when primes are all integers?
If it's just so you can use the square root - there is no rule saying you can't cast that back to an int, and even better, it's possible to calculate the integer square root.
And you don't even need the square root (which is slow to calculate) anyway, you could compare the square of i with x (which is obviously equivalent to comparing i with the square root of x) - better yet, you don't even need to do the multiplication (you can use repeated adding of odd numbers)
Also, after testing whether x is even (if ((x&1)==0)) you never need to put an even number into the trial division ever again since if i divides x and i is even, 2 also divides x.

And you're already applying parallelisation? It's a good thing this is just a test..
GeneralRe: parallel processing Pin
Luc Pattyn12-Mar-10 6:15
sitebuilderLuc Pattyn12-Mar-10 6:15 
GeneralRe: parallel processing Pin
harold aptroot12-Mar-10 6:35
harold aptroot12-Mar-10 6:35 
GeneralRe: parallel processing Pin
Luc Pattyn12-Mar-10 6:49
sitebuilderLuc Pattyn12-Mar-10 6:49 
GeneralRe: parallel processing Pin
harold aptroot12-Mar-10 7:04
harold aptroot12-Mar-10 7:04 
GeneralRe: parallel processing Pin
Luc Pattyn12-Mar-10 7:43
sitebuilderLuc Pattyn12-Mar-10 7:43 
GeneralRe: parallel processing Pin
harold aptroot12-Mar-10 7:47
harold aptroot12-Mar-10 7:47 
GeneralRe: parallel processing Pin
Luc Pattyn12-Mar-10 7:53
sitebuilderLuc Pattyn12-Mar-10 7:53 
GeneralRe: parallel processing Pin
harold aptroot12-Mar-10 8:01
harold aptroot12-Mar-10 8:01 
GeneralRe: parallel processing Pin
Dave Kreskowiak12-Mar-10 8:09
mveDave Kreskowiak12-Mar-10 8:09 
GeneralRe: parallel processing Pin
Luc Pattyn12-Mar-10 8:37
sitebuilderLuc Pattyn12-Mar-10 8:37 
GeneralRe: parallel processing Pin
Dave Kreskowiak12-Mar-10 8:51
mveDave Kreskowiak12-Mar-10 8:51 
GeneralRe: parallel processing Pin
Luc Pattyn12-Mar-10 9:19
sitebuilderLuc Pattyn12-Mar-10 9:19 
Question[vb.net 2008] How get mp3 title,author and lenght ? Pin
nRush11-Mar-10 21:52
nRush11-Mar-10 21:52 
AnswerRe: [vb.net 2008] How get mp3 title,author and lenght ? Pin
Giorgi Dalakishvili11-Mar-10 22:14
mentorGiorgi Dalakishvili11-Mar-10 22:14 
GeneralRe: [vb.net 2008] How get mp3 title,author and lenght ? Pin
nRush11-Mar-10 23:30
nRush11-Mar-10 23:30 
GeneralRe: [vb.net 2008] How get mp3 title,author and lenght ? Pin
Richard MacCutchan12-Mar-10 1:07
mveRichard MacCutchan12-Mar-10 1:07 
GeneralRe: [vb.net 2008] How get mp3 title,author and lenght ? Pin
nRush12-Mar-10 2:54
nRush12-Mar-10 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.