home *** CD-ROM | disk | FTP | other *** search
/ Dream 49 / Amiga_Dream_49.iso / beos / utils / unixcalc-1.4b < prev    next >
Text File  |  1998-02-10  |  10KB  |  224 lines

  1.          File: unixcalc-1.4b.zip
  2.        Author: Michael Griebling (mgriebling@inspired.to)
  3.       Release: 1.4 (10 Jan 1998)
  4. Compatibility: PR/PR2
  5.      Location: contrib/utility
  6.   Description: A CLI-based equation-evaluating calculator with up to 52-digits.
  7.         Notes: See below.
  8.  
  9. WHAT IS IT?
  10.    UnixCalc is a command line calculator which can evaluate algebraic
  11. equations and uses non-volatile history lists to store unlimited
  12. equations, calculated results, and arbitrarily-named variables.  There
  13. are several numerical display modes which include floating point,
  14. scientific, and engineering notation.  The scientific mode supports
  15. imaginary numbers for most functions.  Standard functions
  16. (+,-,*,/,Sqrt,^) are accurate to more than 50 digits.  Based numbers
  17. (2 to 16) are also supported along with all the standard logical
  18. operators (see table below).
  19.  
  20. Some additional features are:
  21.     o imaginary numbers and functions
  22.     o unlimited named variables (up to 16 characters long)
  23.     o automatic history logging of both equations and results
  24.     o full scientific, transcendental, power, and logarithmic operations
  25.     o programmer functions like and, or, shift, rotate, etc., on 172-bits!
  26.     o choice of radian, degree, or gradian angle measurements
  27.     o from 8 to 52 digits
  28.     o numbers from -1E9999 to 1E9999
  29.     o exact decimal number representation
  30.     o convenience functions like square and cube roots, reciprocal, etc.
  31.     o persistant variables, equations, and state
  32.  
  33. RELATED TOOLS
  34.    If you prefer a GUI-based calculator with the same features as
  35. UnixCalc, ExCalc is available for the Amiga on the Aminet & Fish
  36. Disks.  BeCalc for the BeBox will also soon be available.  Both
  37. calculators are shareware products.
  38.  
  39. CHANGES
  40.   UnixCalc now requires OO2C and its new libraries so it will no
  41. longer compiler with O2C.  DO NOT upgrade if you don't want to
  42. rebuild using OO2C, although why you wouldn't want to use OO2C,
  43. which builds faster executables, I don't want to know.
  44.    The source code was also cleaned up a bit to work directly
  45. with the new OO2C library and remove stub modules.
  46.    A new Help command is available which lists all the available
  47. functions and a brief description of each one.
  48.    A bug has been fixed in the string to hexadecimal conversion
  49. routine.
  50.  
  51. TO BUILD & INVOKE
  52.    OO2C and GCC are required to build the executable image for
  53. UNIXCALC.  OO2C can be obtained from http://www.uni-kl.de/ooc.
  54. GCC is generally available from most internet sites.  Once the above
  55. two packages are installed, just type "oo2c -Mv UnixCalc" to build the
  56. calculator.
  57.    The executable can be placed in any suitable directory.  UnixCalc
  58. creates several configuration files in the user's home directory to
  59. store variables and a history list of equations and previous results.
  60. NOTE: This release changes the format of the .CalculatorState.bin
  61. file so you may have to delete this file to get the variable lists
  62. working properly.
  63.    To start a session, type "UnixCalc" and enter an expression to be
  64. evaluated at the prompt.  For example, "UnixCalcD> " is the prompt
  65. which normally appears when the calculator is using base 10 numbers
  66. and using degree measurements for angles.  An empty line will
  67. terminate UnixCalc.
  68.  
  69.  
  70. EQUATION SYNTAX
  71.    Equations are entered using infix notation like "23.4 + 56".
  72. Brackets can be used to explicitly order the expression evaluation
  73. order although standard mathematical ordering is supported (e.g.,
  74. 23+6*5 gives 53 NOT 145).  Most functions like Sin, Cos, etc. use a
  75. single argument which follows the function.  Brackets are not strictly
  76. required (i.e., Sin 45 will evaluate correctly) but are recommended to
  77. avoid ambiguities with equations like Sin 45+23 which first evaluates
  78. Sin 45 and then adds 23 to this number.  An exception to the single
  79. argument rule for functions are the Min/Max functions which take two
  80. arguments separated by a semicolon.  
  81.    All functions can be nested to an arbitrary depth (limited by the
  82. stack size on the host computer).  Maximum expression length is 250
  83. characters although expressions can be strung together by storing
  84. intermediate results in variables and using the variable in subsequent
  85. calculations.  For example: Sqrt(56^2 + 23^2) ST Root1 saves the
  86. answer in a named variable called Root1.  All variables and function
  87. names are case sensitive, so Root1 is different from ROOT1.  Typing
  88. the name of a variable by itself returns the contents of that
  89. variable.  Attempting to access a variable which has not been defined
  90. returns an error.  A maximum of 20 variables are allowed in this
  91. version of UnixCalc of which the first 16 are predefined for you as
  92. M0 to M15.  If you attempt to define more than this number
  93. of variables, you will get an error message.  Delete one or more
  94. variables with the "DEL <variable>" command.  All defined variables
  95. can be displayed with the "List" command.
  96.    Numbers can use separator characters like ",", "'", and "_" (e.g.,
  97. "3,143.43" and "0FFF_1234_0000").  For European countries it is also
  98. possible to swap the '.' and ',' characters -- although this is not
  99. explicitly supported in this version of the calculator.  Contact me
  100. at the address below if you would like to know how to make this
  101. change to the calculator.  Displayed numbers are always without
  102. separator characters although, once again, number displays with
  103. separators are supported by modifying some internal settings.
  104.    The table below lists the supported keywords by the equation parser
  105. (any octal codes if shown as readable characters on your system can
  106. also be used to invoke the corresponding function):
  107.  
  108.           +                    Addition
  109.       -                  Subtraction
  110.       *,╫                  Multiplication
  111.       /,≈                  Division
  112.       ▓                  Squared
  113.       │                  Cubed
  114.       -╣,»╣                  Reciprocal
  115.       ()                  Brackets
  116.       ^, **                  Power
  117.       %                  ╫ 0.01
  118.       &, And              Logical And
  119.       |, Or                  Logical Inclusive Or
  120.       Xor                  Logical Exclusive Or
  121.         ~,Not                  Logical Complement
  122.       Mod                  Modulo
  123.       Div                  Integer Division
  124.       Sqrt                  Square Root
  125.       Cbrt                  Cube Root
  126.       Root                  Any Root
  127.           Abs                             Absolute value
  128.           Rand                            Random number between 0 and 1
  129.       e                  Natural Log Base
  130.       e^                  Power of e
  131.           i,í                   Imaginary number
  132.           °                   Complex angle
  133.           Im                              Imaginary part of a number
  134.           Re                              Real part of a number
  135.           ╗í                  Polar to rectangle conversion
  136.           r                               Complex magnitude
  137.           Conj                  Complex conjugate
  138.           Conv <n>                        Convert n units to destination units
  139.           nCr                             Factorial combinations
  140.           nPr                             Factorial permutations
  141.           Frac                            Fractional part of a number
  142.           Int                             Integer part of a number
  143.           Sign                   Sign of a number (-1 or 1)
  144.        Plot <expression>               Plot the expression as f(M0) (not supported -- yet)
  145.           Min(<x>;<y>)                    Minimum of x and y
  146.           Max(<x>;<y>)                    Maximum of x and y
  147.       Ln                  Natural Logarithm
  148.       Log                  Base 10 Logarithm
  149.       Sin, ASin, Sin»╣            Sine, Arcsine
  150.       Cos, ACos, Cos»╣          Cosine, Arccosine
  151.       Tan, ATan, Tan»╣          Tangent, Arctangent
  152.       Sinh, ASinh, Sinh»╣          Hyperbolic Sine, Arcsine
  153.       Cosh, ACosh, Cosh»╣          Hyperbolic Cosine, Arccosine
  154.       Tanh, ATanh, Tanh»╣          Hyperbolic Tangent, Arctangent
  155.       SBit                  Set Bit
  156.       CBit                  Clear Bit
  157.       TBit                  Toggle Bit
  158.       Shr                  Shift Right
  159.       Shl                  Shift Left
  160.       Asr                  Arithmetic Shift Right
  161.       Ror                  Rotate Right
  162.       Rol                  Rotate Left
  163.       <var-name>                  Variable contents
  164.       ST <var-name>                  Store to variable
  165.           DEL <var-name>          Deletes the variable
  166.       List                  Lists all defined variables
  167.           Help, help                      Displays this list
  168.       Pi                  Constant Pi
  169.       SCI                  Toggle Scientific/Floating Point
  170.       BAS n                  Change to Base n
  171.       DIG n                  Use n Digits
  172.       DP n                  Use n Decimal Places
  173.       DRG                  Toggle Degree/Radian/Grad
  174.  
  175.  
  176. LEGAL STUFF
  177.     UnixCalc -- a command line calculator
  178.     Copyright (C) 1996-1998 Michael Griebling
  179.  
  180.     UnixCalc is free software; you can redistribute it and/or modify
  181.     it under the terms of the GNU General Public License as published by
  182.     the Free Software Foundation; either version 2 of the License, or
  183.     (at your option) any later version.
  184.  
  185.     UnixCalc is distributed in the hope that it will be useful,
  186.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  187.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  188.     GNU General Public License for more details.
  189.  
  190.     You should have received a copy of the GNU General Public License
  191.     along with UnixCalc; see the file COPYING.  If not, write to
  192.     the Free Software Foundation, 59 Temple Place - Suite 330,
  193.     Boston, MA 02111-1307, USA.
  194.  
  195.  
  196. CONTACT
  197.              Michael Griebling
  198.              c/o Computer Inspirations
  199.              150 Clark Blvd., Suite One
  200.              Brampton, Ontario
  201.              Canada, L6T 4Y8
  202.  
  203.              Tel/FAX: (905) 840-7964
  204.  
  205.              e-mail: mgriebling@inpired.to
  206.          http://www.inspired.to/be
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.