[Tugindia] different shaped brackets

Raj Singh raj.ceeri at gmail.com
Mon Nov 1 14:15:38 CET 2010


Hello,

> Is it a good typing style to always have DIFFERENT shaped brackets in
> mathematical equations involving several bracketed expressions?

The usual use of brackets in expressions is for grouping.  So, ( ) is
used as first level grouping, then { } for grouping and then [ ]. If
specific instances and definitions are associated with brackets, then
use them as per definitions.

> ({[a+b+c](g-p)}+j)(d-n+x) = y

As per above guideline, this expression should be written as

{(a + b + c)(g - p) + j}(d - n + x) = y

The order of evaluation (BODMAS) is important while evaluating
expressions. BODMAS stands for Bracket, Order of exponents/root,
Division, Multiplication, Addition, Subtraction. In the above
expression, we want to do "a + b + c" before multiplying with "g - p",
so brackets are necessary to override the default operator precedence.

-- Raj


More information about the tugindia mailing list