p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional JavaScript for Web Developers 2nd edition ISBN: 9780470227800 (http://p2p.wrox.com/forumdisplay.php?f=475)
-   -   Number conversions - has an omission P35 (http://p2p.wrox.com/showthread.php?t=81420)

JGFMK October 29th, 2010 11:38 AM

Number conversions - has an omission P35
 
In the final bullet point on P 35 you state 'if the string contains anything other than these previous formats, it is converted to NaN'

Well what about negative numbers? So "-35" wouldn't return NaN would it?

chroniclemaster1 October 30th, 2010 01:30 AM

Negative numbers are identical to their positive counterparts. NaN is literally for things that aren't a number.

JGFMK October 30th, 2010 06:42 AM

Quote:

Originally Posted by chroniclemaster1 (Post 265039)
Negative numbers are identical to their positive counterparts. NaN is literally for things that aren't a number.

You aren't telling me anything I don't already know here! I was pointing out to the author, the omission of negative numbers in his list of bullet points made the final 'catch-all' statement invalid.

nzakas November 1st, 2010 06:11 PM

Yes, you are correct, the wording should be changed. I'll make sure this gets updated.


All times are GMT -4. The time now is 09:11 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.