Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

REPL Mode

Start with ccalc (no arguments, stdin is a terminal).

Prompt

The prompt always shows the current value of ans:

[ 0 ]:
[ 42 ]:
[ 0xFF ]:

ans

Every expression result is stored in ans. Expressions that start with an operator use ans as the left-hand operand (partial expressions):

[ 0 ]: 100
[ 100 ]: * 2
[ 200 ]: + 50
[ 250 ]: / 5
[ 50 ]:

REPL commands

CommandAction
exit, quitQuit
clsClear the screen (also Ctrl+L)
help, ?Show cheatsheet
help <topic>Detailed help (see topic list below)
whoShow all defined variables
clearClear all variables
clear <name>Clear a single variable
pShow current decimal precision
p<N>Set precision to N decimal places (0–15)
hex / dec / bin / octSwitch display base
baseShow ans in all four bases
wsSave workspace to file
wlLoad workspace from file
disp(expr)Print value without updating ans
fprintf('fmt')Print formatted string (\n, \t, \\ supported)
configShow config file path and active settings
config reloadRe-read config.toml and apply changes

Help topics for help <topic>: syntax functions bases vars script matrices examples

Keyboard shortcuts

KeyAction
/ Browse input history
Ctrl+RReverse history search
← → / Home / EndCursor movement
Ctrl+AGo to beginning of line
Ctrl+EGo to end of line
Ctrl+WDelete word before cursor
Ctrl+UDelete from cursor to beginning of line
Ctrl+KDelete from cursor to end of line
Ctrl+LClear screen
Ctrl+C / Ctrl+DQuit

Silencing a line

Append ; to suppress output. For expressions, ans is still updated. For assignments, ans is never updated regardless of ;.

[ 0 ]: 0.06 / 12;          % expression — ans updated, output suppressed
[ 0.005 ]: rate = 0.07;    % assignment — silent, ans unchanged
[ 0.005 ]:

Multiple ;-separated statements on one line — all but the last are silent:

[ 0 ]: a = 1; b = 2; c = 3;    % all silent
[ 0 ]: a = 1; b = 2             % a = 1 silent, b = 2 shown
b = 2
[ 0 ]:

Configuration

Settings that persist across sessions (precision, default base) live in config.toml. The config command shows the active values; config reload applies any edits without restarting.

[ 0 ]: config
config file: /home/user/.config/ccalc/config.toml
precision:   10
base:        dec

History

Input history is saved to ~/.config/ccalc/history and restored on the next session. Each session is marked with a timestamp comment:

% --- Session: 2026-04-01 14:22:07 UTC ---
rate = 0.06 / 12
n = 360
% --- Session: 2026-04-01 15:10:44 UTC ---
hypot(3, 4)

The marker uses % so it is harmless if accidentally recalled and executed.