CONCALC(1) User Commands CONCALC(1)

# NAME¶

concalc - console calculator

# SYNOPSIS¶

concalc [options] "expression"

concalc -m script "path"

# DESCRIPTION¶

concalc calculates the given input term and returns the result as text. Please use will have problems with the shell interpretor. If you give concalc more than one expression, all expression will be put together.

# CALCULATION SYNTAX¶

standard calculations
2*(3+4/9)^3
standard operations
+ - * / ^ % sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh ln log & | ! && || ~ >> << x rnd sqrt curt root integ d/dx
sqrt12 curt8
sin3.64+ln5
fourth root of nine: 4root9
differential calculation of 2x^2-3x+3 at x=9: d/dx(2x^2-3x+3,9)
integration of sinx+cosx between -1 and 3.2: integ(sinx+cosx,-1,3.2)
save the result of a calculation in variable A: 12*45/2->A
multiply the saved value with 2: A*2
The last result is saved in the answer memory: ans+1

# CONSTANTS¶

euler constant
pi; example: sin(pi/2)

12.34
12.23e-5
12i-5

# OPTIONS¶

The argument is a number between 2 and the maximal possible output length (normally 18).
The mode can be std (default, normal scientific calculatons), base (for logic functions and base-n calculatons) or script (for executing scripts). In scripting mode, the last argument must be the path to the script file.
This option enables complex numbers for the calculation. They are switched off by default.
The argument must be one of hex (hexadecimal), dec (decimal, default), oct (octal) and bin (binary). This option can only be used when -m base is set.
Output the version of Concalc.
Outputs a short help.

# SCRIPTING¶

The script interpreter of calc uses a C-like programming syntax. The following command are supported.

if(condition)

command for condition true;

else command for condition false;

while(condition)

command that is run while condition is true;

for(initialisation; condition; count-command)
command that is run while condition is true;

print( output to print out );

getline; // read a text line from stdin and returns this text

getkey; // return the key pressed by the user
// blocks until the user presses any key

keystate; // returns the key pressed by the user or 0 if no key was pressed
// nonblocking

sleep( time in microseconds ); //Script is stops for the given time

==, != equal, unequal

>=, <=, >, < greather or equal, less or equal, greather, less

-> calculator set operator

= C-like set operator

(float) floating point value

(int) integer value

(string) text value

(bool) boolean value

No bugs known!

# AUTHOR¶

Rainer Strobel <rainer1223@users.sourceforge.net>