spar man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]


SPAR(1)								       SPAR(1)

NAME
       spar - a modular console calculator

SYNOPSIS
       spar [options] [--] expression

DESCRIPTION
       Spar is a console calculator, primarily intended for problem solving in
       arbitrary precision. It supports also modules (aka code that can be
       loaded dynamically) and a number of other features, such as: user vari‐
       ables, functions, and constants.

   OPTIONS
       -d, --decimals
	   Set the decimal precision (number of digits printed after
	   the point).

       -i, --integers
	   Set the integer precision (number of digits printed before
	   the point).

       -c, --config
	   Use a user-defined modules configuration file.

       -q, --quiet
	   Don't display the welcome message.

       -h, --help
	   Display usage information and exit.

       -v, --version
	   Print version information and exit.

       --  Terminate option list: now all arguments is interpreted as
	   an expression to evaluate.

NUMBERS
       The most basic element in spar is the number.  Numbers are dou‐
       ble precision numbers. All numbers are represented internally as
       a standard C double variable. There are no attributes of num‐
       bers, but the precision can affect the number output. This pre‐
       cision is both in the integer part and the decimal part.

       For example: The number 0.123456789 is represented internally as
       a double precision variable, but if we change the precision, the
       output will change: 0.123456789 = 0.123457

VARIABLES
       Numbers can be stored in named variables. Variable names begin
       with a letter followed by any number of letters, digits and
       underscores. The variable names are case sensitive. Variables
       may have values assigned to them as well as used in expressions
       and it contains a special data member that stores the "previous"
       value".

       To declare a variable you must supply both a name and a value.
       Any undeclared variable generate an error.  For example, to
       declare the variable i of value 5 enter:
		 i = 5

CONSTANTS
       Constants are special variables that is	read-only.  This  means
       that  you can read a constant value but you can modify. There is
       a number of "preloaded" variables such as "e", "pi" ecc.

FUNCTIONS
       spar  support  a	 number	 of  often  used  scientific  functions
       (directly  from The Spar Library). For example, to get the value
       of the natural logarithm in 0 enter:
		 log(0)

   Trig Functions
       These are the familiar `sin', `cos', and `tan'  functions.   The
       arguments  to  all  of  these functions are in units of radians;
       recall that pi radians equals 180 degrees.

   Inverse Trig Functions
       These are the usual arc sine, arc cosine and arc	 tangent  func‐
       tions,  which  are  the inverses of the sine, cosine and tangent
       functions respectively.

   Exponents and Logarithms
       These are the 'exp' group, 'log' group, 'pow' group  and	 'sqrt'
       group.

   Hyperbolic Functions
       sinh,  cosh,  tanh. The functions in this section are related to
       the exponential functions.

   Inverse Hyperbolic Functions
       asinh, acosh, atanh. The functions in this section  are	related
       to the Hyperbolicfunctions.

   Infinite Functions
       isnan, finite, isinf.

   Special Functions
       Factorial, sum, and other specific spar functions.

EXPRESSIONS
       The  numbers  are  manipulated  by  expressions	and statements.
       Since the math parser was implemented to be interactive,	 state‐
       ments and expressions are executed as soon as possible.

       A  simple expression is just a constant. spar displays constants
       using the current precision (see OPTIONS). Full expressions  are
       similar	to many other high level languages. Since there is only
       one kind of number, there are no rules for mixing types.

       In the  following  descriptions	of  legal  expressions,	 "expr"
       refers  to  a  complete	expression and "var" refers to a simple
       variable.

       - expr The result is the negation of the expression.

       expr + expr
	      The result of the	 expression  is	 the  sum  of  the  two
	      expressions.

       expr - expr
	      The result of the expression is the difference of the two
	      expressions.

       expr * expr
	      The result of the expression is the product  of  the  two
	      expressions.

       expr / expr
	      The  result  of the expression is the quotient of the two
	      expressions.

       expr % expr
	      The result of the expression is the "remainder" and it is
	      computed in the following way.

       expr ^ expr
	      The  result  of  the expression is the value of the first
	      raised to the second.

       ( expr )
	      This alters the standard precedence to force the	evalua‐
	      tion of the expression.

       var = expr
	      The variable is assigned the value of the expression.

       var    This  prints  variable  value's: note that "var" could be
	      also a constant.

COMMANDS
       help   Print a brief commands notice. If a command name is  sup‐
	      plied print a detailed command report.

       warranty
	      Print a longer warranty notice. No arguments.

       comment
	      Add a comment to a variable. At least two arguments.

       consts Print the built-in constants table. No arguments.

       funcs  Print the built-in functions table. No arguments.

       modules
	      Print the all loaded modules. No arguments.

       old    Swap  the	 current  variable  value with the old one. One
	      argument.

       quit   Program termination.

       run    Run a module. Note that you must supply  a  valid	 module
	      name  otherwise,	the  list  of  the  loaded  modules  is
	      printed.

       vars   Print all user variables.

FEATURES
       Spar supports terminal features (termios) to allow  the	program
       to be more user-friendly and also more robust.

   READLINE OPTION
       Spar can be compiled (via configure script) to use the GNU read‐
       line input editor library.  This allows	the  user  to  do  more
       editing of lines before sending them to spar.

       It  also	 allows for a history of previous lines typed: the his‐
       tory can be viewed by '´ key, whereas the readline  auto-comple‐
       tion  was implemented by the TAB key. For more information, read
       the user manuals for the GNU  readline  and  history  libraries.
       Instead	the  key  '!' run the last command and, finally the key
       ':' can be used to display a specific history item. For example:
       ':1' shows the first history item.

   SIGNALS SUPPORT
       During  a  session,  the SIGINT signal (usually generated by the
       control-C character from the terminal), SIGSTP  signal  (usually
       generated  by  the  control-Z  character	 from the terminal) and
       SIGTERM signal will cause execution to be interrupted. After all
       run-time	 structures  have  been	 cleaned  up, a message will be
       printed to notify the user that spar is aborted.	 All  variables
       and modules are removed during the clean up process.

   TERMCAP SUPPORT
       The  control  key EOF is inhibited. spar restore this setting on
       exit.

BUGS
       The best way to submit a bug report for Spar is to use the  file
       BUG-REPORT, that will enable me to fix the problem. Please visit
       the Spar homepages at:

	    http://spar.sourceforge.net/index.html (main site)
	    http://web.tiscalinet.it/Davide18/index.html

       for the latest version, patches and documentation.

FILES
       /usr/local/bin/spar		       Spar
       /usr/local/lib/libspar.so	       Spar Library
       /usr/local/include/spar/*	       Spar Headers
       /usr/local/lib/spar/*		       Spar modules
       /usr/local/share/spar/modules_config    Spar modules config

AUTHOR
       Davide Angelocola davide178@inwind.it

ACKNOWLEDGMENTS
       The author would	 like  to  thank  Sebastian  Ritterbusch  (Ras‐
       cal@Ritterbusch.de)  for	 his extensive help in testing the pro‐
       gram and the documentation. Many great suggestions  were	 given.
       Please  visit  his  website http://rascal.sourceforge.net or the
       sourceforge project at http://sourceforge.net/projects/rascal.

SEE ALSO
       bc(1)	An arbitrary precision calculator language
       Spar can be used also as library, a API reference can be founded
       via  web at http://sourceforge.net/projects/spar. Please help me
       to extend and correct it.

				  26 Jun 2001			       SPAR(1)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net