Heronian triangles: Difference between revisions
m
→{{header|Perl 6}}: use atomicint to make concurrency safe
m (→using iSQRT: added whitespace, aligned the END with the DO loop.) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: use atomicint to make concurrency safe) |
||
Line 3,284:
sub MAIN ($maxside = 200, $first = 10, $witharea = 210) {
my @
my atomicint $i;
(1 .. $maxside).race.map: -> $c {
for 1 .. $c -> $b {
for $c - $b + 1 .. $b -> $a {
if primitive-heronian-area($a,$b,$c) -> $area {
@
}
}
}
}
@h = (@
say "Primitive Heronian triangles with sides up to $maxside: ", +@h;
|