Function Reference

(back)

Here is every function that comes with TouchRPN, along with a quick description of what it does:

!Stores value at Y to variable at X.
"String creation operator, pushes string until terminated by '"' token.
(Start comment, terminate with ')'
*Multiply X by Y
+Add X to Y
-Subtract X from Y.
-rollOpposite of roll
-rotRotate X,Y,Z to Y,Z,X
/Divide Y by X
2dupDuplicates X and Y (X,Y -> X,Y,X,Y
:Starts word (function) definition. Follow with name of word, body of word, and end with ';'
;defines end of word
<Pushes true if Y < X, else false
=Pushes true if X=Y
>Pushes true if Y > X, else false
@Pushes value of variable at X.
[Unit definition startclose with ']' alone.
acosinverse cosine
acoshinverse hyperbolic cosine
againBranches back to begin, infinite loop.
allocAllocates Obj-C object specified by the next token (ex'alloc NSString')
andBinary and logical 'and' (bitwise if both are integers).
asininverse sine
asinhinverse hyperbolic sine
ataninverse tangent
atanhinverse hyperbolic tangent
baseunitRepresents X in basic units
beginDefines beginning of while loop.
cconjTake complex conjugate of X (2+3i -> 2-3i).
ceilPushes lowest integer greater than X
classPushes class specified by the next token (ex'class NSString')
clrClear entire stack
constantStores X as a constant named by the next token. Constants can be pushed by calling their names (ex. '3.14 constant pi').
coscosine
coshhyperbolic cosine
cvarCreates variable and pushes it onto the stack.
debugPrints stack to stdout
depthPushes stack depth
descPushes description of object in X
digsets number of digits to be displayed by real numbers
docPush documentation of next token onto stack. (ex. 'doc doc')
dropDeletes X
dupDuplicates X
ePushes the numerical constant 'e'
elseDefines second block to be evalued if X evaluates to False.
engSets real numbers to be displayed in engineering mode
expExponentiate X (push e^X).
fixSets real numbers to be displayed in fixed digits
floorPushes highest integer less than X
getPushes value of key (specified by next token) of object in X
ifConditional. If X evaluates to True, execute block (terminated by else or then), otherwise, execute block between else and then.
impops Y, pushes imaginary component of X
inConverts Y to units in X
inSIConverts X to SI
initInitializes object at X. Shorthand for 'ocm init'
invInvert X (push 1/X).
lnTake logarithm of X (push ln(X))
ltsepSet the separator for thousandths to the string in the X register, the separator to the left (lt) of the decimal pt.
magpops X, pushes magnitude of X
modPushes lowest integer greater than X
negNegate X (push -X)
nipDeletes Y
nostripDon't strip trailing zeroes off of real numbers
notBinary and logical 'not' (bitwise if an integer).
ocmSends a message specified by the next token to object on stack. Arguments are taken from stack, so for N arguments, the target must be at N+1. (ex'alloc NSNumber 4 ocm initWithInt:')
orBinary and logical 'or' (bitwise if both are integers).
overPushes Y, so X,Y -> Y,X,Y
piPush pi onto stack (~100 digits are stored).
pickGrabs the Xth element int the stack (X=ERROR,Y=0,Z=1,etc..)
powTake Y to power of X.
repops X, pushes real component of X
repeatBranches back to 'begin', looping a begin...while...repeat loop.
rollRolls top X+1 elements (brings element X to front)
rotRotate X,Y,Z to Z,X,Y
roundPushes nearest integer to X
rtsepSets the thousands separator to the string in the X register, the separator to the right (rt) of the decimal pt.
sciSets real numbers to be displayed in scientific mode
setSets value of key (next token) in object Y to value at X. Keeps Y on stack.
shortSets real numbers to be displayed in shortest mode
simpunitAttempts to simplify units of X
sinsine
sinhhyperbolic sine
splituniSplits number from units (number->Y, units->X)
sqrtTakes square root of X register
strcatConcatinates string in X, with string in Y
stripStrip trailing zeroes off of real numbers
strpopbTakes last letter of string in X and pushes it onto stack
strpopfRemoves first character in string at X and pushes it onto stack.
strpushbAdds character at X to end of string in Y.
strpushfPushes character at X onto front of string in Y.
strsplitSplits string in Y by looking for instances of string in X
swapSwaps X and Y
tantangent
tanhhyperbolic tangent
thenCloses if statement.
truncPushes greatest integer between zero and X
tuckDuplicates X, but in Z (X,Y -> X,Y,X)
undoUndo last operation
untilPops X register, if true, branches back to 'begin'.
variableCreate named variable, (short for 'cvar constant').
vocab{Pushes new vocabulary onto vocab stack, named by string at X
whilePops X, if true, continues on to 'repeat', if false, skips to after 'repeat'.
}vocabPops top off of vocab stack