Skip to content

Functions

mudkip201 edited this page Feb 13, 2018 · 48 revisions

For this chart, the top three items on the stack, in order, are x,y,z

Symbol Function
x^10 §
¹ x^11 §
² x^2 §
³ x^3 §
x^4 §
x^5 §
x^6 §
x^7 §
x^8 §
x^9 §
x/10 §
x/11 §
x/2 §
x/3 §
x/4 §
x/5 §
x/6 §
x/7 §
x/8 §
x/9 §
Ƨ If x is an array, every second element of x; otherwise, every second item on the stack
° z^y mod x †† ‡ §§§§
| Does x divide y? † §§§
! x factorial §
÷ Integer division of y by x † §§§
If x is an array, gets its maximum; otherwise, gets the maximum of the stack
If x is an array, gets its minimum; otherwise, gets the minimum of the stack
Gets input
If x is an array, returns [min(x),max(x)] ; otherwise, returns [min(stack),max(stack)]
If x is an array, reverses the order of the elements of x; otherwise, reverses the order of the stack
Swaps x and y
¬ Negates x §
^ y^x † §§§
« Bit-shifts y left by x places † §§§
» Bit-shifts y right by x places † §§§
Is y<=x? † §§§
Is y>=x? † §§§
< Is y<x? † §§§
> Is y>x? † §§§
= Is y=x? † §§§
Is y!=x? † §§§
Square root of x §
Cube root of x §
Fourth root of x §
Is y in x? §§
~ -x §
˜ unsigned two's-complement of x (e.g., if x is 5, then ˜x is 3) § ‡
% y mod x †
/ y/x † §§§
+ y+x † §§§
- y-x † §§§
* y*x † §§§
Returns the xth triangle number §
Returns the xth pentagonal number §
Returns the xth hexagonal number §
Bitwise AND †
Bitwise OR †
Bitwise NAND †
Bitwise NOR †
Bitwise XOR †
Bitwise XNOR †
Returns the floor of x §
Returns the ceiling of x §
Returns the nearest integer to x §
Returns [floor(y/x), y%x] - integer division and remainder † §§§
× Cartesian product of y and x
Å Absolute value of x §
Á Pushes the elements of x onto the stack (e.g., if x=[0,1,2,3], then 0,1,2,3 are pushed onto the stack in order
ą If x is a number, turns x into an array of digits; if x is a string, turns x into an array of characters ‡
á Moves contents of the stack into an array §
ɐ Modifier for any function marked with †/†† or §§
  • If the function is marked by †, then it returns [[oper(x0,y0),oper(x0,y1),...],[oper(x1,y0),oper(x1,y1),...],...].
  • If the function is marked by ††, then it returns [[[oper(x0,y0,z0),oper(x0,y0,z1),...],[oper(x0,y1,z0),oper(x0,y1,z1),...],...],[[oper(x1,y0,z0),oper(x1,y0,z1),...],[oper(x1,y1,z0),oper(x1,y1,z1),...],...],...], but removes a dimension if the corresponding variable is a number and not a list (e.g., if, for example, z is a number, then it returns [[oper(x0,y0,z),oper(x0,y1,z),...],[oper(x1,y0,z),oper(x1,y1,z),...],...]).
  • If the function is marked by §§, then y must be a list of lists, and it returns [[oper(x0,y0),oper(x0,y1),...],[oper(x1,y0),oper(x1,y1),...],...].
ɓ Converts int(x) to a binary string (e.g., 5 becomes 101) §
Ç Returns arccosh(x) §
Č Returns cosh(x) §
Ƈ Returns the unicode character with codepoint x § ‡
Ć Returns the xth Catalan number §
ç Returns arccos(x) §
č Returns cos(x) §
¢ Returns 1-x §
ć yCx † §§§
ĉ Clears the stack
ɔ Counts the number of occurrences of y in x §§
Đ Pushes x onto the stack twice
ð Returns the list of divisors of x § ‡
Returns the list of prime factors of x § ‡
Reverses the order of the digits in x ‡
ǝ e^x §
10^x §
Returns the xth Fibonacci number § ‡
Ƒ Flattens the array at the top of the stack
Converts to float §
Ǥ Returns the GCD of x and y † §§§
Ħ Returns the Hamming weight of a number in binary § ‡
Ĩ Interprets y as a base-x string † ‡ §§§
Ɩ Casts x to an integer §
ǰ If x is a list, joins the elements of x with no delimiters; otherwise, joins everything in the stack with no delimiters
Returns the base-10 log of x §
Ļ Returns ln(x) §
Ľ Returns the base-x log of y † §§§
Ĺ Returns LCM(x,y) † ‡
Ł If x is an array, returns the length of x; otherwise, returns the size of the stack
Ŀ Returns the xth Lucas number §
ļ Returns the base-2 log of x §
ɬ Appends the string containing the letters (i.e., 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")
ɫ Appends the string containing the lowercase letters (i.e., 'abcdefghijklmnopqrstuvwxyz')
ł If the top of the stack is not 0, go back to the last '`' seen
If x is an array, gets its median; otherwise, gets the median of the stack
Ϻ If x is an array, gets its mode; otherwise, gets the mode of the stack - if there are multiple, only returns one item (the smallest)
ɯ Returns the modular inverse of y for modulus x † ‡ §§§
ɳ Appends the string containing the digits (i.e., '0123456789')
Prints y as a base-x number, followed by a newline character † ‡
Ƥ Prints x, followed by a newline character
Ƿ Prints x as a binary number, followed by a newline character § ‡
Ҏ Returns the product of the digits of x § ‡
Returns the yth x-gonal number † ‡ §§§
Is x a palindrome?
x^x §
yPx † ‡ §§§
Pushes all permutations of x onto the stack as an array
Prints y as a base-x number † ‡ §§§
ƥ Prints x
Is x prime? § ‡
ƿ Prints x as a binary number § ‡
ϼ Returns the distinct prime factors of x § ‡
ҏ Palindromizes x (e.g., if x="abe", returns "abeeba"; also, if x=[1,2,3], returns [1,2,3,3,2,1])
Returns the partition number of x § ‡
Returns the xth prime number § ‡
Ř Returns the array [y,y+1,...,x] ‡ §§§
ɽ Returns a random 32-bit integer ‡
ɾ Returns a random integer in the range [y,x) ‡ §§§
ɹ Returns a random bit
ʀ If x is an array, returns a random element of x
ř Returns the array [1,2,...,x] ‡ §
ŕ Pops the top element of the stack and does nothing with it
Returns a random float in [0,1)
ʁ Modifier character; if the top of the stack is an array, reduces the array using the next character's operation (e.g., if the array is [1,2,3,4], and the operation is '^', then it returns [1,8,81]); otherwise, it reduces the stack using the next character's operation
Ş If x is an array, sorts x in descending order; otherwise, sorts the stack in descending order
Š Returns sinh(x) §
Ŝ Returns arcsinh(x) §
Ś Sums the digits of x ‡ §
Ș If y is an array, reverses the last x items of y; otherwise, reverses the last x items of the stack (e.g., if x is 2, then it switches y and z)
ş If x is an array, sorts x in ascending order; otherwise, sorts the stack in ascending order
ŝ Returns arcsin(x) §
š Returns sin(x) §
Ť Returns tanh(x) §
Ŧ Returns arctanh(x) §
Ț Returns φ(x), where φ is Euler's totient function § ‡
Returns the transpose of x if x is a matrix
ť Returns tan(x) §
ŧ Returns arctan(x) §
If x is an array or string, returns the unique elements of x; otherwise, returns the unique elements of the stack
ʊ Returns the string containing the uppercase letters (i.e., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
Ž Interleaves the elements of x and y (e.g., if x=[x0,x1,x2] and y=[y0,y1,y2], returns [x0,y0,x1,y1,x2,y2])
ž Removes all instances of 0 from x, where x is a list
µ If x is an array, gets its mean; otherwise, gets the mean of the stack
Π If x is an array, multiplies its elements; otherwise, multiplies everything on the stack
Ʃ If x is an array, sum its elements; otherwise, sum everything on the stack
If x is an array, are all elements of x equal?; otherwise, are all of the elements on the stack equal?
x double-factorial § ‡
` Indicator for looping
Gets the item at index x from y ‡
Increments x §
Decrements x §
Returns the sums of adjacent elements in x (e.g., if x=[1,2,3,4,5], then it returns [3,5,7,9])
Returns the differences between adjacent elements in x (e.g., if x=[1,2,3,4,5], then it returns [1,1,1,1])
Pushes an array consisting of x 1's (e.g., if x=3, then pushes [1,1,1]) ‡
· Returns the dot product of x and y
? If the top of the stack is 1, continues execution; otherwise, jumps to the next ':' and continues from there
: The 'Else' in the 'If (...) Then (...) Else (...) - if read, jumps to the next ';' and continues from there
; The end of an if-then-else construction
± If x>0, pushes 1; If x==0, pushes 0; If x<0, pushes -1 §
\ If x and y are sets, then returns an array containing all elements of y not in x; otherwise, returns all elements of y not equal to x (set difference - y\x)

† If x is an array and y is not, returns [oper(x0,y), oper(x1,y), ...]. If y is an array and x is not, returns [oper(x,y0),oper(x,y1), ...]. If x and y are arrays, then returns [oper(x0,y0), oper(x1,y1), ..., oper(xk,yk)] where k=min(len(x),len(y)).

††Like †, but with x, y, and z.

§ If x is an array, returns [oper(x0),oper(x1),...].

§§ If y is an array, returns [oper(y0,x),oper(y1,x),...].

§§§ If x and y are arrays, returns [oper(x0,y0),oper(x1,y1),...].

§§§§ Like §§§, but with x, y, and z.

‡ Casts the inputs to integers if they are floats.

Clone this wiki locally