Home| general |src.bin|task| rst_eval Index

rst_eval

Syntax
rst_eval --help
rst_eval [-c cast] [-f format] expr
Synopsis

Evaluate a mathematical expression.

Options
--helpprint the help message and exit.
--versionprint the RST version number and exit.
-c castforce the final calculated value of the expression to be cast data type.
-f formatuse the string format to format the output text. The string uses the printf syntax.
exprthe mathematical expression to evaluate.
Description

Evaluate a mathematical expression.

The calculated value is written to standard output

The expression to evaluate should be quoted.

Examples
rst_eval "2.5*3.12/6"

Evaluate 2.5*3.12/6.

rst_eval -c int -f "%d" "2.3*0.5"

Evaluate 2.3*0.5, convert the result to an integer and print it using the format "%d".