About BhashaIndia | Contribute | SiteMap | Register | Sign in to Windows Live ID
  Developers Patrons
Hindi Tamil Kannada Gujarati Marathi Telugu Bengali Malayalam Punjabi Konkani Oriya Sanskrit Nepali
Home > Developers > KnowHow > UnicodeMaths > Precedence Welcome Guest!

Operator Precedence

  • Everyone knows that multiply takes precedence over add, e.g., 3+5×3 = 18, not 24
  • C-language precedence is too intricate for most programmers to use extensively
  • TEX doesn't use precedence; relies on { } to define operator scope
  • In general, ( ) can be used to clarify or overrule precedence
  • Precedence reduces clutter, so some precedence is desirable (else things look like LISP!)
  • But keep it simple enough to remember easily

Operands in subscripts, superscripts, fractions, roots, boxes, etc. are defined in part in terms of operators and operator precedence. While such notions are very familiar to mathematically oriented people, some of the symbols that we define as operators might surprise one at first. Most notably, the space (ASCII 32) is an important operator in the plain-text encoding of mathematics.

Layout Operator Precedence

Subscript, superscript   ¯
Integral, sum          ò S P
Functions   Ö
Times, divide   / * × • •
Other operators   Space ". , = - + Tab
Right brackets   )]}|
Left brackets   ([{
End of paragraph   FF EOP

A minimal list of operators is given above, where FF = U+000C and an EOP can be given by a lone LF, a lone CR, or a CRLF, where LF = U+000A and CR = U+000D.

As in arithmetic, operators have precedence, which streamlines the interpretation of operands. The operators are grouped above in order of increasing precedence, with equal precedence values on the same line. For example, in arithmetic, 3 + 1/2 = 3.5, not 2.


Partner Profile | Privacy Statement | Why Passport | Testimonials
This site uses Unicode for non-English characters and uses Open Type fonts.
©2003-2007 Microsoft Corporation. All rights reserved.