Jump to content

Arithmetic/Rational: Difference between revisions

m
m (added ;Task: and ;Related task: (bold) headers.)
Line 2,530:
 
=={{header|Perl 6}}==
{{worksWorks with|Rakudorakudo|20152016.1208}}
Perl 6 supports rational arithmetic natively.
<lang perl6>for 2..2**19 -> $candidate {
Line 2,539:
}
}
if $sum.denominatornude[1] == 1 {
say "Sum of reciprocal factors of $candidate = $sum exactly", ($sum == 1 ?? ", perfect!" !! ".");
}
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.