Amicable pairs: Difference between revisions

Content added Content deleted
Line 4,653: Line 4,653:


==={{header|PL/I-80}}===
==={{header|PL/I-80}}===
Rather than populating an array with the sum of the proper divisors and then searching, the approach here performs an direct test, saving memory, and at a minimal penalty in execution speed, even though about 25% more calls are made to sumf() than would be required simply to initialize an array.
Rather than populating an array with the sum of the proper divisors and then searching, the approach here calculates them on the fly as needed, saving memory, and avoiding a noticeable lag on program startup on the ancient systems that hosted PL/I-80.
<syntaxhighlight lang="pl/i">
<syntaxhighlight lang="pl/i">
amicable: procedure options (main);
amicable: procedure options (main);