Pell's equation: Difference between revisions

m
→‎{{header|REXX}}: aligned some statements.
m (→‎{{header|REXX}}: added commas to the huge numbers, simplified the SAY expressions for the output of X and Y.)
m (→‎{{header|REXX}}: aligned some statements.)
Line 968:
if $=='' | $=="," then $= 61 109 181 277 /*Not specified? Then use the defaults*/
d= 28 /*used for aligning the output numbers.*/
do j=1 for words($); #= word($, j) /*process all the numbers in the list. */
parse value pells(#) with x y /*extract the two values of X and Y.*/
cx= comma(x); Lcx= length(cx); cy= comma(y); Lcy= length(cy); L#Lcy= length(#cy)
say 'x^2 -'right(#, max(4, Llength(#))) "* y^2 == 1" ,
' when x='right(cx, max(d, Lcx)) " and y="right(cy, max(d, Lcy))
end /*j*/
exit 0 /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/