请输入您要查询的字词:

 

单词 InfixNotation
释义

infix notation


Infix notation is how we usually read and write arithmeticPlanetmathPlanetmath expressions. In this notation, the operator goes between the operands in the expression:

(operand1)(operator)(operand2)

E.g., 3+2, or 196×11, etc.

Infix notation suffers from some ambiguity; e.g.

3+9×2

could mean (3+9)×2 or 3+(9×2). Parentheses are needed to specify the order of operations unambiguously.

Postfix notation (or reverse-Polish notation) does not suffer this ambiguity; but it is considered harder for humans to read (hence its primary use in computer applications).

The “usual” fix for the ambiguity problem described above is to provide a convention regarding precedence of operations. This is typically done for computer parsing of mathematical expressions rather than in math done by hand, because in the former case, the computer must have some standard rules to proceed. For example, it is typical to make multiplicationPlanetmathPlanetmath “higher precedence” than addition, so in the above case, 9×2 would be performed before adding the result to 3.

The ambiguity problem only occurs when multiple operators are present in one expression, and thus, the associative law does not hold. E.g., there is no ambiguity in 1+2+3, because (1+2)+3 is the same as 1+(2+3), by the associative property of addition.

随便看

 

数学辞典收录了18232条数学词条,基本涵盖了常用数学知识及数学英语单词词组的翻译及用法,是数学学习的有利工具。

 

Copyright © 2000-2023 Newdu.com.com All Rights Reserved
更新时间:2025/5/4 22:21:53