Thread Unerwartete Ergenisse mit Promise.start (10 answers)
Opened by Kuerbis at 2015-09-02 12:52

Kuerbis
 2015-09-06 21:17
#182070 #182070
User since
2011-03-20
947 Artikel
BenutzerIn
[default_avatar]
Oder so:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env perl6
use v6;

my $n = 25_000;
my $runs = 1;
my $result;
for ^$n { $result += $_ ** $_ }
say $result;

for ^$runs {
    my $sum = [+] await map { start { $_ ** $_ } }, ^$n;
    say "$sum $_";
    die $_ if $sum != $result;
}

View full thread Unerwartete Ergenisse mit Promise.start