The functions ( sin, cos, tan, log, log10, exp, sqrt, fabs) are available. The trigonometric functions accept arguments in degrees, unless overridden by the radian flag. Also the function `hms2d() can convert hour:minute:second expressions into floating point numbers.
If val cannot evaluate a string to floating point number, it prints out an error message and generates a non-zero exit code.
The logical operators (&, |, !, &&, ||, >, < ) are also interpreted in a manner similar to C. Except for < and > , the operands are first converted to integer by floor(x+0.5) then the operation performed, and the result converted to floating point. In addition since the results have only integer values, the print mode is set to integer whenever any of these operators appear.
baby - prints out the number in babylonian format e.g. +12:35:12
radian - uses radian arguments to the trigonometric functions.
verify - shows the arguments before evaluation.
format=s - changes output format for floating point numbers from %.4f to that in the command line. Note the Cconvention is used.
pmod=# - assumes that the answer lies 0. < x < mod . mod=# - assumes that the answer lies -mod/2 < x < mod/2. .
help - displays options.
converts the babylonian value 12:34 to decimal, adds 1.34, converts back to babylonian and prints out the value. Note: the quotation marks are needed to prevent the shell from seeing them.
val "(4*15.4) > 26.5"
Takes the product of 4*15.4 , sees that it is bigger than 26.5 and prints out the value 1. If the statement were not true val would print out 0. Again note the quotes.
val "10^($mags/2.5)" format=%.2f
converts the shell variable `mag' to a factor and prints out the result to two significant figures. The shell can `see through' the double quotes and perform variable substitution.
Formats are not checked for the correct type, and may lead to bizarre results if mistyped.