Integer roots: Difference between revisions

m
→‎{{header|REXX}}: added comments to the REXX section header, fixed closing HTML lang tag.
m (→‎{{header|REXX}}: added the REXX language.)
m (→‎{{header|REXX}}: added comments to the REXX section header, fixed closing HTML lang tag.)
Line 22:
 
=={{header|REXX}}==
No error checking is performed to ensure the root is a non-zero integer.
<br>Negative roots are allowed.
<lang rexx>/*REXX program calculates the Nth root of a number to a specified number of decimal digs*/
parse arg num root digs . /*obtain the optional argumenstarguments from CL*/
if num=='' | num=="," then num= 2 /*Not specified? Then use the default.*/
if root=='' | root=="," then root= 2 /* " " " " " " */
Line 54 ⟶ 56:
numeric digits od /*set numeric digits to the original.*/
if oy<0 then return 1/_ /*Is the root negative? Use reciprocal*/
return _/1 /*return the Yth root of X to invoker.*/</rexxlang>
'''output''' &nbsp; when the defaults are being used:
<pre>