2006-11-17 16:24:38 +00:00
|
|
|
|
|
|
|
\section math math - Perform mathematics calculations
|
|
|
|
|
|
|
|
\subsection math-synopsis Synopsis
|
|
|
|
<tt>math EXPRESSION</tt>
|
|
|
|
|
|
|
|
\subsection math-description Description
|
|
|
|
|
2007-08-01 17:35:24 +00:00
|
|
|
math is used to perform mathematical calculations. It is only a very
|
2006-11-17 16:24:38 +00:00
|
|
|
thin wrapper for the bc program, that makes it possible to specify an
|
2006-12-12 17:10:37 +00:00
|
|
|
expression from the command line without using non-standard extensions
|
2010-09-18 02:18:26 +00:00
|
|
|
or a pipeline. Simply use a command like <code>math 1+1</code>.
|
2006-11-17 16:24:38 +00:00
|
|
|
|
|
|
|
For a description of the syntax supported by math, see the manual for
|
2006-12-12 17:10:37 +00:00
|
|
|
the bc program. Keep in mind that parameter expansion takes place on
|
|
|
|
any expressions before they are evaluated. This can be very useful in
|
|
|
|
order to perform calculations involving environment variables or the
|
|
|
|
output of command substitutions, but it also means that parenthesis
|
|
|
|
have to be escaped.
|
|
|
|
|