Post Reply 
Temperature Conversion
01-29-2014, 07:37 PM (This post was last modified: 01-29-2014 07:43 PM by Han.)
Post: #17
RE: Temperature Conversion
(01-29-2014 07:01 PM)jgreenb2 Wrote:  By that reasoning the following expression should always require parenthesis:

5+3/4

As we all learned as children, however, there exists a convention for operator precedence that resolves the apparent ambiguity:

5+3/4 = 5 + (3/4)

Your example is incorrect. There is no ambiguity in your example because division has higher precedence than addition. On the other hand, if you actually meant to add 5 and 3 first, you would need to use ()'s to specify that: (5+3)/4.

Quote:There is no need for "magic" or "mind-reading" or any of the other pejoratives that are being injected into this conversation.

I did not mean anything demeaning or offensive by "the calculator cannot read your mind"; I am sorry if it came off that way. My point was there is no algorithm that will choose the correct interpretation for all users.

Quote:Nonetheless, the original post wasn't about adding or subtracting temperatures. It was just noting that an apparently sensible expression like:

−13_°F▶_°C

gives an unexpected result. It seems quite clear that this is an operator precedence issue that could be easily resolved.

Somehow this part was not quoted when I responded. I see your point (and agree).

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Temperature Conversion - jgreenb2 - 01-28-2014, 06:26 PM
RE: Temperature Conversion - jgreenb2 - 01-29-2014, 11:09 AM
RE: Temperature Conversion - Han - 01-29-2014, 02:46 PM
RE: Temperature Conversion - eried - 01-29-2014, 03:08 PM
RE: Temperature Conversion - Miguel Toro - 01-29-2014, 03:46 PM
RE: Temperature Conversion - Tim Wessman - 01-29-2014, 04:12 PM
RE: Temperature Conversion - Han - 01-29-2014, 04:00 PM
RE: Temperature Conversion - jgreenb2 - 01-29-2014, 04:31 PM
RE: Temperature Conversion - Miguel Toro - 01-29-2014, 04:49 PM
RE: Temperature Conversion - Han - 01-29-2014, 05:23 PM
RE: Temperature Conversion - jgreenb2 - 01-29-2014, 07:01 PM
RE: Temperature Conversion - Han - 01-29-2014 07:37 PM
RE: Temperature Conversion - toml_12953 - 01-29-2014, 01:01 PM
RE: Temperature Conversion - Tugdual - 01-29-2014, 01:14 PM
RE: Temperature Conversion - eried - 01-29-2014, 02:26 PM
RE: Temperature Conversion - Tugdual - 01-29-2014, 09:19 PM
RE: Temperature Conversion - CR Haeger - 01-29-2014, 10:23 PM
RE: Temperature Conversion - John Colvin - 01-30-2014, 12:58 AM
RE: Temperature Conversion - jgreenb2 - 01-30-2014, 02:07 AM



User(s) browsing this thread: 1 Guest(s)