daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 65 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. proc `^`*(f: proc(x: untyped): untyped, power: int): proc(x: untyped): untyped =
  2.     ## "Exponentiation" of a function
  3.     ## (f^n)(x) := f(f(f( ... n times ... f(f(f(x))) ... )))
  4.     return proc(x: untyped): untyped =
  5.         result = x
  6.         for _ in 1 .. power:
  7.             result = f(result)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top