Anonymous user
Heronian triangles: Difference between revisions
→{{header|REXX}}: added check for: if side A is even, sides B and C must be odd. This decreased execution time by around 1/3.
m (→{{header|REXX}}: aligned statement and a comment.) |
(→{{header|REXX}}: added check for: if side A is even, sides B and C must be odd. This decreased execution time by around 1/3.) |
||
Line 695:
Heron: @.=.; y=' '; minP=9e9; maxP=0; minA=9e9; maxA=0; Ln=length(N)
#=0; #.=0; #.2=1 #.3=1; #.7=1; #.8=1 /*¬good √.*/
do a=3 to N;
inc=1+ev
do
do c=b to N by inc; p=ab+c; s=p/2 /*calc Perimeter, S*/
_=s*(s-a)*(s-b)*(s-c); if _<=0 then iterate /*_ isn't positive.*/
if pos(.,_)\==0 then iterate /*not an integer. */
|