Integer roots: Difference between revisions

added RPL
(→‎{{header|Wren}}: Added the BigInt example.)
(added RPL)
Line 1,280:
3
</pre>
 
=={{header|RPL}}==
{{trans|Python}}
« DUP 1 -
→ x n n1
« '''IF''' x 2 < '''THEN''' x
'''ELSE'''
« n1 OVER * x 3 PICK n1 ^ / IP + n / IP »
→ func
« 1 func EVAL func EVAL
'''WHILE''' ROT DUP2 ≠ SWAP 4 PICK ≠ AND
'''REPEAT''' func EVAL '''END'''
MIN
»
'''END'''
» » '<span style="color:blue">IROOT</span>' STO <span style="color:grey"> @ ''( x n → root ) with root^n ≤ x</span>''
 
=={{header|Ruby}}==
1,150

edits