![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd_gdVn3MMtImIpBVYTPlodrST5mfCbjuvpIa4H78IQBbZRy9DdRDhLBqs0LRpZjF3j4udDzDykzFkuAUUTuXMdwyP55R7BWter07w7pDKi6mXouYWsObqkAF-dXzdUi9XJEIdAIikButr/s320/compute2.gif.bmp)
The COMPUTE assigns the result of an arithmetic expression to a data-item. The arithmetic expression is evaluated according to the normal arithmetic rules. That is, the expression is normally evaluated from left to right but bracketing and the precedence rules shown below can change the order of evaluation.
Precedence Symbol Meaning
1. ** Power
2. * Multiply
/ Divide
3. + Add
- Subtract
Note that unlike some other programming languages COBOL provides the ** expression symbol to represent raising to a power.
No comments:
Post a Comment