expr ( en )Last modification : 2013/01/26 19:16 |
|
---|---|
Index / Recent changes / News / Forum / Download / Contact | Edit |
expr is the standard way to evaluate arithmetic expressions.
expr can recognize the 4 main operators (+, -, *, /) and % (the mod operator that return the reminder of the division of two integer), and power operator . As it is in KSH the syntax is very strict. first, if you only need to print the result of an operation just write it like that:
Important notice: you must not forget the spaces between the operator and the operands. If you need to make operations on variables you have to use the ((...)) syntax:
Since there are so few operators, it is possible to switch to an enhanced arithmetic expressions evaluator: bc.
|
|
Wiki utilisant PumaWiki 1.0
2024/12/21 18:10 -- en -- 3.149.233.108 |