Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

How formulas are evaluated - Order of precedence

When you are creating formulas that contain different kinds of operators, it is important to consider the order in which the program evaluates the separate parts of your formula. This order is called order of precedence.

Simple order of precedence follows basic math rules of precedence. Multiplication and division are performed first, from left to right, then addition and subtraction are performed. For example:

5 + 10 * 3 = 35

The multiplication 10 * 3 is performed first to get 30. Then, 30 is added to 5 to arrive at the final answer, 35.

Now, if your intention is to add 5 to 10 and then multiply the sum by 3, you have to modify the order of precedence with parentheses. You can do that as follows:

(5 + 10) * 3 = 45

It is clear that parentheses have a higher precedence than the add, subtract, multiply, and divide operators. They redirect the order of calculation.

NOTE: When a formula contains other formulas such as:

@Extension * 107.5%

the program first evaluates the embedded formula, @Extension, following order of precedence rules and then evaluates the rest of the primary formula.

Formulas 101

337

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]