Extcalc Description
|
Calc - Documentation1. General Information2. Installation3. Usage3.1 Parameters3.2 Syntax3.3. Scripting5. Additional Information1. General InformationCalc is a calculator for the Linux console. It should also work on all other unix systems. Calc is just the parser-algorithm of extcalc packed into a simple console program. You can use it if you have need a calculator in your shell.Calc is still alpha, but the main features should work now. This documentation refers to Calc version 0.8.5. 2. Installation1. Unpack package: "tar -xzf calc-0.8.5.tar.gz"2. Change directory: "cd calc-0.8.5" 3. Run configure: "./configure" 4. Compile program: "make" 5. Become root: "su" 6. Install files: "make install" If all steps run without errors, you will be able to start calc if you type calc and any calculation you want into your console. 3. Usage3.1 ParametersThe following command line options will work in this version:-m mode --mode modeSet calculator mode. This can be std for normal scientific calculations or base for logic operations and base-n calculations or script for running scripts if you choose script mode, the last agrument must be the path to the script file, not the script itsself. Example: calc -m base "10 | 5" -b base --base baseSet the base for base-n calculations. base must be one of bin, hex, dec or oct. The default value is dec for decimal. This option can only be used when mode is set to base. Example: calc -m base -b bin "100101 | 110111" -a angle type --angle angle typeSet angle type for calculation Arguments: deg (degrees), rad (radiant), gra (grade) Example: calc -a deg "sin30" -c --complexEnable complex numbers -o output length --output output lengthSet maximum digits of output Arguments: number between 2 and the max. possible length (normally 18) Example: calc -o 5 "sqrt2" -h --helpPrint a short help text. -v --versionPrint version info 3.2 SyntaxInput calculations into calc:calc "input" Example: calc "2*(3+4/9)^3" sqare root: "sqrt value" Example 1: sqrt12 Example 2: sqrt(12*(3+3.2²)) trigonometric functions and logarithms: "function value" Example: sin3.64+ln4.86 Known functions: sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh ln log lg other roots: exponent root value Example (fourth root of nine): 4root9 differential calculation: d/dx(function,x-value) Example: (differential calculation of 2x^2-3x+3 at x=9): d/dx(2x^2-3x+3,9) integration: integ(function,start-value,end-value) Example (integration of sinx+cosx between -1 and 3.2): integ(sinx+cosx,-1,3.2) Variables: It is possible to save results in 26 variables, which are represented by the letter A - Z. Set variable: asin0.45 ->A Recall variable: sinA Number formats: normal floating point: 12345 -124.35 -4.67e-6 complex numbers: -2i 2.5+6i -3.5i+4.2 with different bases (only integer values): hex0F3C6 bin10011011 oct43532 4. Script ProgrammingIf you want to run a script, the script must be stored in a seperate file. To run the script, use the following command:calc -m script "path" The script language is the same as described in the Extcalc documentation. If you need a description of the language or some example files, please look at the description of Extcalc. 5. Additional InformationThis version of Calc is also tested at 64-bit-Systems (AMD Opteron). It should work on every CPU and on all standard Unix Systems but it is mainly programmed for Linux.The precisision of the Calculator is similar to the values mentioned in the documentation of Extcalc because it uses the same calculation code. |