Parallel calculations: Difference between revisions

→‎{{header|JavaScript}}: Cleaned up the text
(Added JavaScript version -- uses web workers)
(→‎{{header|JavaScript}}: Cleaned up the text)
Line 560:
</lang>
 
This portion appendsFor each of the numbers with their factors as the results arrive into an html tagnumber witha theworker idis "result"spawned. Once the final worker completes its task (worker_count is reduced to 0), the reduce function is called to determine which number is the answer.
<lang javascript>
var numbers = [12757923, 12878611, 12757923, 15808973, 15780709, 197622519];
Line 610:
 
</lang>
 
=={{header|Perl 6}}==
Assuming that <tt>factors</tt> is defined exactly as in the prime decomposition task:
Anonymous user