Fuzzy Octo Guacamole, 7 bytes
#Fuzzy Octo Guacamole, 7 bytes non-competing, FOG is newer than the challenge
EZO@pZE
This is the equivalent of a function in FOG. It assumes the input is on the stack. This can be assigned to a function by the code "EZO@pZE""f"o
, where f
is any single-char name you want to assign. Then use it like any other command. Example: "EZO@pZE"'f'o^f
.
Explanation:
EZO@pZE
E # Push E (2.718....)
Z # Reverse stack (it is now [e, input])
O # log(x, y) which is ln(input)
@ # Exit. (implicit output) Nothing after this gets run.
p # x^y (power function)
Z # Reverse stack
E # Push E.
Reversed:
EZp@OZE
E # Push E (2.718....)
Z # Reverse stack (it is now [e, input])
O # x^y (power function)
@ # Exit. (implicit output) Nothing after this gets run.
p # log(x, y) which is ln(input)
Z # Reverse stack
E # Push E.