-
Posted by Solo on Sun, 15 Jun 2008 20:29:13
2 last lines should say:
return ((celsius * 1.8) + 32) end
-
Posted by jnwhiteh on Sat, 17 May 2008 23:34:44
2 last lines should say:
return ((celsius * 1.8) + 32) end
Thanks for the report, we'll get it added to the errata list to be fixed in the next printing.
-
Posted by Frankaladin on Sun, 15 Jun 2008 04:13:57
Just got to this page... Yep, you should definately add this to the online errata.
--Frank
-
Posted by Frankaladin on Sun, 15 Jun 2008 15:34:25
I see it in the errata now. Thank you.
So... you don't need the extra backets around the +32... is there a preferred way to write it?
I tested and it works either way
return(celsius * 1.8) + 32
or
return((celsius * 1.8) +32)
--Frank
-
Posted by jnwhiteh on Sun, 15 Jun 2008 20:29:13
I see it in the errata now. Thank you.
So... you don't need the extra backets around the +32... is there a preferred way to write it?
I tested and it works either way
return(celsius * 1.8) + 32
or
return((celsius * 1.8) +32)
--Frank
Indeed, it's the same rules as math. As a matter of fact it will work without any parenthesis due the rules of operator precedence. Since multiplication is higher precedence than addition, the celsius and 1.8 are computed before 32 is added to it. The parenthesis are typically added (as noted in the chapter) for readability of the code, so you can look back later and understand what you were _trying_ to accomplish.
-
Posted by Nosnam on Fri, 07 Nov 2008 02:26:02
Bump, this doesn't seem to show up in the Errata any more. It's pretty minor, but I'm sure someone out there will pull their hair out when they can't figure out what's wrong ;)
-
Posted by jnwhiteh on Fri, 07 Nov 2008 11:50:14
We lost quite a bit of data a while back, and we're still working to recover. Doing things as they come up is manageable but having to go through a backlog is a nightmare =/