Post Reply 
Temperature Conversion
01-29-2014, 05:23 PM (This post was last modified: 01-29-2014 05:24 PM by Han.)
Post: #14
RE: Temperature Conversion
(01-29-2014 04:49 PM)Miguel Toro Wrote:  
(01-29-2014 04:31 PM)jgreenb2 Wrote:  Wow…this is making things a bit more complex than needed. It's just a precedence issue -- '_' has precedence over binary '-' or '+' but it should NOT have precedence over unary '-'. For temperatures things are bit more complex because of the additive constant. See the HP48 User Manual Pg 10-11 for a description of one (IMHO sensible) solution.

But your specific example doesn't make sense to me. The answer to 5_°F+13_°F▶_°C is that it's an error since ▶ is simply a macro for CONVERT and 5_°F+((CONVERT(13_°F,0_°C)) won't parse. This has nothing to do with the expected behavior of

-13_°F▶_°C

As per Tim comment, It may be more about the fact that 5_°F+13_°F will never get performed, so it never get converted:

(5_°F+13_°F)▶_°C ===> CONVERT((5_°F+13_°F),0_°C) ===> Error: Invalid input.

I didn't write (5_°F+13_°F)▶_°C -- I wrote 5_°F+13_°F▶_°C without parentheses. I am now aware of the _other_ issues underlying this particular example. Ignoring the issues around temperature addition, my point was that without parentheses, this "shortcut" for the the CONVERT command is ambiguous because 5_°F+13_°F▶0_°C could be interpreted by one person as 5_°F+(13_°F▶0_°C) and by another person to mean (5_°F+13_°F)▶0_°C. Therefore, one cannot expect a machine to be able to magically decide the right answer for all users. Perhaps a better example of the point I am making would be someone typing:

5_°C+13_°F▶0_°C

Are they trying to add two different temps and wanting the result to be in °C? or are they trying to convert one temp (13_°F) into °C first, and then adding that result to 5_°C. Hence my point about adding parentheses where needed when one chooses to use an ambiguous "macro" over the non-ambiguous command.

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: 2 Guest(s)