Heronian triangles: Difference between revisions
Content deleted Content added
→{{header|REXX}}: eliminated the need for a (true) SQRT subroutine, used an integer version (iSQRT) instead; it made the Heronian program four times faster. |
m →{{header|REXX}}: changed the calculation of digits (for precision) to handle different interpretations of numeric precision (using trailing zeroes). |
||
Line 686: | Line 686: | ||
if first=='' | first==',' then first= 10 /* " " " " */ |
if first=='' | first==',' then first= 10 /* " " " " */ |
||
if area=='' | area==',' then area=210 /* " " " " */ |
if area=='' | area==',' then area=210 /* " " " " */ |
||
numeric digits max(9, 1+length(N** |
numeric digits 99; numeric digits max(9, 1+length(N**5)) /*ensure 'nuff*/ |
||
call Heron /*invoke Heron subroutine. */ |
call Heron /*invoke Heron subroutine. */ |
||
say # ' primitive Heronian triangles found with sides up to ' N " (inclusive)." |
say # ' primitive Heronian triangles found with sides up to ' N " (inclusive)." |