Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A simplier math formula
Message
From
17/12/2008 04:05:17
 
 
To
17/12/2008 03:27:40
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
General information
Forum:
Politics
Category:
Other
Miscellaneous
Thread ID:
01367448
Message ID:
01368028
Views:
8
>you say
>
>?5-2^2
>
>different than
>
>?-2^2+5
>
>that can't acceptable...

Hi Metin,

Why so argumentative? IMHO this is a stupid discussion, we may jut as well discuss whether a cup is half full or half empty.

A vague or unclear task will always give room for interpretation, which this is all about. Plus it's a question of following defined standard. When I studied electronics 35 years ago, one of my subjects was advanced mathematics, and I mean really advanced mathemathics. We learned that the defined standard was that if a calculation started with a minus immediately followed by a number, it meant that the number had a negative value. If the minus was meant as an operator, the immediately following calculation should be inside a parenthesis. In your case this means:
1. -2^2 == (-2)*(-2) = 4.
2. -(2^2) == -(2*2) = -4
3. 0-2^2 is 4 or -4 depending on which standard you follow. 5-2^2 will also give either 1 or 9 depending on which definition is followed.

I really don't remember 100%, but I mean to recall that * and / had precedence over + and -. The reason why I don't remember was that we were told very clearly by our professor to play safe, and ALWAYS use parenthesises to avoid any confusion, misinterpretation and misunderstanding.

Not all programs follows the same standards, which makes it necessary to EITHER use parenthesises OR check the documentation for the program in question. There is no "correct" or "wrong" answer here.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform