math -- performs simple math operations
NAME
math -- performs simple math operations
MATH - OSIRIS library of scripts
DESCRIPTION
math is a wrapper for "echo ... | bc -lm"
EXAMPLES
math 2 + 3 will do addition
math "2 * 3" does multiplication (note the quotes when "*" used).
math 2 \* 3 another way of doing multiplication without quotes.
math 2 x 3 is also multiplication (no quotes needed)
math 4 - 5 subtraction
math 4 / 5 division.
For use within scripts, with passed arguments:
mxy `math $x x $offset` `math $y x $offset`
(Note that the variable substitution for $x happens before the "x"
representing multiplication gets translated into "*".)
See Also
The shell script math
OSIRIS script index
Go to:
OSIRIS Home Page -
Instruments Home Page -
Keck Home Page
Last modified: Thu Mar 17 17:47:37 2005