To invoke a particular function math must be linked or copied to the name of the desired function. When math is named as a standard math subroutine, <math_function> reads /rdb tables from the standard input and performs the indicated function from the math subroutine library. The input is one or two columns from the table, depending on the function. The default columns used by <math_function> are the first (and second, in the case of functions which operate on two elements). The default output of <math_function> is a single column having the same name as the function and containing the function result.
$ cat mathtable a b c - - - 1 2 3 4 5 6 7 8 9
To execute the sin function on mathtable:
$ ln math sin (UNIX) C> cp math.exe sin.exe (DOS) $ sin < mathtable sin --- 0.841471 -0.756802 0.656987
To perform sin on column b of mathtable and name the resulting column b.sin:
$ sin b b.sin < mathtable a b c b.sin - - - ----- 1 2 3 0.909297 4 5 6 -0.958924 7 8 9 0.989358
To perform the hypot function on columns a and b and replace column c with the result:
$ ln math hypot (UNIX) C> cp math.exe hypot.exe (DOS) $ hypot a b c < mathtable a b c - - - 1 2 2.236068 4 5 6.403124 7 8 10.630146SEE ALSO