Talk:Rare numbers: Difference between revisions
Content added Content deleted
m (→Tweaks, C++: response to Nigel Galloway) |
|||
Line 76: | Line 76: | ||
== the 1<sup>st</sup> REXX version == |
== the 1<sup>st</sup> REXX version == |
||
This is the 1<sup>st</sup> REXX version, before all the optimizations were added: |
This is the 1<sup>st</sup> REXX version, before all the optimizations were added: |
||
<syntaxhighlight lang="rexx"> |
|||
/*REXX program to calculate and display an specified amount of rare numbers. */ |
|||
numeric digits 20; w= digits() + digits() % 3 /*ensure enough decimal digs for calcs.*/ |
numeric digits 20; w= digits() + digits() % 3 /*ensure enough decimal digs for calcs.*/ |
||
parse arg many start . /*obtain optional argument from the CL.*/ |
parse arg many start . /*obtain optional argument from the CL.*/ |
||
Line 103: | Line 104: | ||
if _>=0 then do; x= _; $= $ + q |
if _>=0 then do; x= _; $= $ + q |
||
end |
end |
||
end /*while q>1*/; return $ |
end /*while q>1*/; return $ |
||
</syntaxhighlight> |
|||
Pretty simple, but slow as molasses in January. |
Pretty simple, but slow as molasses in January. |
||