zahniser.net :: software

— hsiloP —

Calculator program

 

— HyperList —

Hierarchical to-do lists

— Hexie —

Hex editor

— Mirth —

Read daily comics

— Strange —

Chaotic attractors

— etc. —

Other programs

 

 

 

contact email:

michael at zahniser dot net

hsiloP :: List of commands

Nature, to be commanded, must be obeyed. (Bacon, 1620)

Below is a list of commands that are available in the hsiloP program. Some commands have two names: a full text name and a shortcut name. If a shortcut exists for a given command, it is shown in (parentheses). For example, the shortcut for the add command is "+".

Most commands are functions that remove one or more numbers from the bottom of the stack, replacing them with the result of the function. For example, the add command removes two numbers from the stack and then places their sum on the stack. When multiple arguments are listed, they are ordered from top to bottom; for example, "Input: x, y" means that two numbers will be removed from the stack; x is the top number of the two, and y is the bottom number. There are some special commands that do not remove any arguments, such as pi, which takes no arguments and returns the value of the mathematical constant pi. Others do not add anything to the stack; for example, the bin command switches to binary display mode but does not alter the contents of the stack.

Named keys are enclosed in <angle backets>. For example, <tab> means to press the Tab key on your keyboard, not to type in the word "tab". Similarly, "<ctl> + x" means to hold down the Control key, then press X. On a Macintosh, you can use the Apple key instead of the Control key.

Several commands use the clipboard. The cut and copy commands copy a single number into the clipboard, and the paste command pastes a single number. The kill command cuts numbers one by one and appends them to the clipboard; the yank command pastes an entire list of numbersfrom the clipboard. See copyall, commands, history, and execute for more uses of the clipboard.

To quit hsiloP, type <ctl> + q or press the <escape> key.

A printable version of this command list is available here.

commandeffects
<tab> If a command name begins with the currently entered text, replace that text with the complete command name.
<left>
<right>
Beginning with the currently entered text, scroll alphabetically through the list of available commands.
<up>
<down>
Scroll through the history of commands that have been entered since the program started running.
abs Input: x. Output: the absolute value of x.
acos Input: x. Output: the arccosine of x, in degrees or radians depending on the current settings (see deg, rad)
add
(+)
Input: x, y. Output: the sum of x and y.
and
(&)
Input: x, y, both rounded to integers. Output: The bitwise AND of x and y.
asin Input: x. Output: the arcsine of x, in degrees or radians depending on the current settings (see deg, rad)
atan Input: x. Output: the arctangent of x, in degrees or radians depending on the current settings (see deg, rad)
atan2 Input: x, y. Output: the angle defined by the given <x, y> vector, in degrees or radians depending on the current settings (see deg, rad)
bin Set the calculator display and input mode to binary (base 2). To enter a binary number without changing the input mode, prefix it with 0b; for example, 0b1101 is decimal number 13.
ceil Input: x. Output: the smallest integer that is greater than or equal to x.
choose
(c)
Input: n, k, both rounded to integers. Output: the number of combinations that can be made by choosing k objects out of n, if order does not matter and repetition is not allowed.
clear
(<ctl> + n)
Clear the stack, resetting the calculator to its initial state.
commands
(?)
Copy a list of all command names into the clipboard. To view the list, paste it into a text editor.
copy
(<ctl> + c)
Copy the bottom number on the stack into the clipboard, replacing the clipboard contents.
copyall
(<ctl> + a)
Copy the entire stack into the clipboard, replacing the clipboard contents.
cos Input: an angle x, in radians or degrees (see deg, rad). Output: the cosine of x.
cube Input: x. Output: x cubed.
cut
(<ctl> + x)
Remove the bottom number from the stack and copy it into the clipboard, replacing the clipboard contents.
dec Set the calculator display and input mode to decimal (base 10). To enter a decimal number without changing the input mode, prefix it with 0d; for example, 0d42 is decimal number 42.
deg Set the angle mode to degrees. Trigonometric functions will interpret their input as angles in degrees, and will produce output in degrees.
dist Input: x1, y1, x2, y2. Output: the distance between (x1, y1) and (x2, y2), calculated using the Pythagorean theorem.
div
(/)
Input: x, y. Output: x divided by y.
dup
(<ctl> + d)
Duplicate the bottom number on the stack.
e Input: none. Output: the value of the mathematical constant e.
execute
(<ctl> + e)
Execute a list of commands from the clipboard. (For example, a list produced by the history command).
exp Input: x. Output: the mathematical constant e raised to the power of x.
factor Input: x, rounded to an integer. Output: the prime factors of x.
factorial
(!)
Input: x, rounded to an integer. Output: x factorial; that is, the product of the integers between 1 and x.
flip
(<ctl> + f)
Reverse the order of the stack.
floor Input: x. Output: the largest integer that is less than or equal to x.
frac Input: x. Output: the fractional component of x.
gcd
(gcf)
Input: x, y, both rounded to integers. Output: the largest number that is a factor of both x and y.
hex Set the calculator display and input mode to hexadecimal (base 16). To enter a hexadecimal number without changing the input mode, prefix it with 0x; for example, 0x3a is decimal number 58.
history
(<ctl> + h)
Copy into the clipboard a list of all commands that have been executed since the program began running.
inv Input: x. Output: 1 divided by x.
kill
(<ctl> + k)
Append the bottom number on the stack to the clipboard, adding to whatever is there. This allows you to cut multiple lines and later to yank them all back.
lcm Input: x, y, both interpreted as integers. Output: the smallest number that is an integral multiple of both x and y.
lg Input: x. Output: the base 2 logarithm of x.
ln Input: x. Output: the base e logarithm of x.
log Input: x. Output: the base 10 logarithm of x.
mod
(%)
Input: x, y. Output: the remainder when x is divided by y.
mul
(*)
Input: x, y. Output: the product of x and y.
neg Input: x. Output: -x.
not
(~)
Input: x, rounded to an integer. Output: the bitwise complement of x.
oct Set the calculator display and input mode to octal (base 8). To enter an octal number without changing the input mode, prefix it with 0o; for example, 0o74 is decimal number 60.
or
(|)
Input: x, y, both rounded to integers. Output: The bitwise OR of x and y.
paste
(<ctl> + v)
Paste a single value from the clipboard onto the stack. To paste a list of values, use yank.
permute
(p)
Input: n, k, both rounded to integers. Output: the number of permutations that can be made by choosing k objects out of n, if order matters and repetition is not allowed.
phi Input: none. Output: the value of the mathematical constant phi, the golden ratio.
pi Input: none. Output: the value of the mathematical constant pi.
pow Input: x, y. Output: x raised to the y power.
prod Replace the entire stack with the product of all numbers in the stack.
rad Set the angle mode to radians. Trigonometric functions will interpret their input as angles in radians, and will produce output in radians.
range Input: x, s, c. Output: c numbers in an arithmetic series, beginning with x and adding s each time.
root Input: x, y. Output: the yth root of x.
rot
(<ctl> + r)
Move the number at the bottom of the stack to the top, shifting the others down.
round Input: x. Output: x rounded to the nearest integer.
select
(s)
Input: n, k, both rounded to integers. Output: the number of combinations that can be made by choosing k objects out of n, if order does not matter and repetition is allowed.
sin Input: an angle x, in radians or degrees (see deg, rad). Output: the sine of x.
sort
(<ctl> + o)
Sort the numbers in the stack from smallest to largest.
sqrt Input: x. Output: the square root of x.
square Input: x. Output: x squared.
sub
(-)
Input: x, y. Output: x minus y.
sum Replace the entire stack with the sum of all numbers in the stack.
swap
(<ctl> + s)
Swap the bottom number in the stack with the number immediately above it.
tan Input: an angle x, in radians or degrees (see deg, rad). Output: the tangent of x.
todeg Input: x, an angle in radians. Output: x converted to an angle in degrees. The current angle mode is not changed (see deg, rad).
torad Input: x, an angle in degrees. Output: x converted to an angle in radians. The current angle mode is not changed (see deg, rad).
trunc Input: x. Output: x truncated to an integer using a standard C++ typecast.
undo
(<ctl> + z)
Undo the last command.
xor
(^)
Input: x, y, both rounded to integers. Output: The bitwise XOR of x and y.
yank
(<ctl> + y)
Paste a list of numbers from the clipboard onto the stack.