Heronian triangles: Difference between revisions
Content deleted Content added
m →{{header|REXX}}: optimized the hisqrt function for this task. |
m →{{header|REXX}}: condensed two generic functions, added a comment, optimized the hisqrt function. |
||
Line 1,398:
end /*a*/
return # /*return # of Heronian triangles.*/
/*──────────────────────────────────HGCD
hGCD: procedure; parse arg x; do j=2 for 2;
/*──────────────────────────────────HISQRT subroutine────────────────────────────────────────────────────────────────────*/
hIsqrt: procedure; parse arg x; q=1 /*x=x%1; if x==0|x==1 then return x*/ /*◄──note these 2 commented statements.*/
/*──────────────────────────────────SHOW
▲/*──────────────────────────────────SHOW subroutine─────────────────────*/
show: m=0; say; say; parse arg ae; say arg(2); if ae\=='' then first=9e9
say; $=left('',9) /* [↓] skip the nothings. */
|