.\" Process this file with .\" groff -man -Tascii concalc.1 .\" .TH CONCALC 1 "APRIL 2007" Linux "User Commands" .SH NAME concalc \- console calculator .SH SYNOPSIS .B concalc [options] "expression" .B concalc -m script "path" .SH DESCRIPTION .B concalc calculates the given input term and returns the result as text. Please use \" \" at the given expression because otherwise you will have problems with the shell interpretor. If you give .B concalc more than one expression, all expression will be put together. .SH CALCULATION SYNTAX .IP "standard calculations" 2*(3+4/9)^3 .IP "standard operations" + - * / ^ % sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh ln log & | ! && || ~ >> << x rnd sqrt curt root integ d/dx .IP "sqare root and cubic root" sqrt12 curt8 .IP "trigonometric functions and logarithms" sin3.64+ln5 .IP "other roots" fourth root of nine: 4root9 .IP "differential calculation" differential calculation of 2x^2-3x+3 at x=9: d/dx(2x^2-3x+3,9) .IP integration integration of sinx+cosx between \-1 and 3.2: integ(sinx+cosx,\-1,3.2) .IP "set variables" save the result of a calculation in variable A: 12*45/2->A .IP "recall variables" multiply the saved value with 2: A*2 .IP "use last result" The last result is saved in the answer memory: ans+1 .SH CONSTANTS .IP e euler constant .IP pi pi; example: sin(pi/2) .SH NUMBERS .IP standard 12.34 .IP "with exponent" 12.23e-5 .IP complex 12i-5 .SH OPTIONS .IP "-o, --output [output length]" The argument is a number between 2 and the maximal possible output length (normally 18). .IP "-m, --mode [calculator mode]" 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. .IP "-c, --complex" This option enables complex numbers for the calculation. They are switched off by default. .IP "-b, --base [calculator base]" 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. .IP "-a, --angle [angle type]" The argument must be one of deg (degrees), rad (radiant), gra (grade). .IP "-v, --version" Output the version of Concalc. .IP "-h, --help" Outputs a short help. .SH SCRIPTING The script interpreter of calc uses a C-like programming syntax. The following command are supported. .IP "if expression" if(condition) command for condition true; else command for condition false; .IP "while loop" while(condition) command that is run while condition is true; .IP "for loop" for(initialisation; condition; count-command) command that is run while condition is true; .IP "print command" print( output to print out ); .IP "getline command" getline; // read a text line from stdin and returns this text .IP "getkey command" getkey; // return the key pressed by the user // blocks until the user presses any key .IP "keystate command" keystate; // returns the key pressed by the user or 0 if no key was pressed // nonblocking .IP "sleep command" sleep( time in microseconds ); //Script is stops for the given time .IP "compare operators" ==, != equal, unequal >=, <=, >, < greather or equal, less or equal, greather, less .IP "set operators" -> calculator set operator = C-like set operator .IP "type converting" (float) floating point value (int) integer value (string) text value (bool) boolean value .SH BUGS No bugs known! .IP "If you find one, please report it by e-mail to the author." .SH AUTHOR Rainer Strobel .SH "SEE ALSO" http://extcalc-linux.sourceforge.net