Exponentiation in Forth

Plain Text

Public Domain

Integer exponentiation in Forth

Download (right click, save as, rename as appropriate)

Embed

1
: ** ( n u -- n^u ) 1 swap 0 u+do over * loop nip ;