Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript 5th Edition
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaScript 5th Edition
This is the forum to discuss the Wrox book Beginning JavaScript, 5th Edition by Jeremy McPeak; 978-1-118-90333-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript 5th Edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 4th, 2015, 09:46 AM
Authorized User
Points: 134, Level: 2
Points: 134, Level: 2 Points: 134, Level: 2 Points: 134, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2015
Location: the sea
Posts: 10
Thanks: 4
Thanked 5 Times in 4 Posts
Default Ch. 2, parseInt(): book claims can be used for converting to binary, etc.?

In the "Data Conversion" section of Chapter 2, the book claims that "you can use parseInt() to convert numbers to binary (Base 2), hex (Base 16), and other number systems." In reality, it does the opposite.

The method toString() is the method that is useful for converting a number to different number systems, not parseInt(). parseInt(10, 2) results in the number 2, as the book says, but that is not a conversion of ten into binary, but an interpretation of 10 as being binary already, in which case its base 10 value would be 2. The base 10 value of ten would be represented 1010 in binary.

Has anyone else noticed this error? Is there something I am missing here?
Reply With Quote
  #2 (permalink)  
Old January 8th, 2016, 02:40 PM
jmcpeak's Avatar
Wrox Author
Points: 467, Level: 7
Points: 467, Level: 7 Points: 467, Level: 7 Points: 467, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2005
Location: , Texas, USA.
Posts: 87
Thanks: 0
Thanked 17 Times in 16 Posts
Default

No, you're not missing anything. The book is both wrong and extremely poorly worded in that passage.
Reply With Quote
The Following User Says Thank You to jmcpeak For This Useful Post:
Moby (January 9th, 2016)
  #3 (permalink)  
Old January 9th, 2016, 12:22 AM
Authorized User
Points: 134, Level: 2
Points: 134, Level: 2 Points: 134, Level: 2 Points: 134, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2015
Location: the sea
Posts: 10
Thanks: 4
Thanked 5 Times in 4 Posts
Default

Thanks for your reply. Can this be added to the errata for the book?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting JPEG images into binary Bassaam .NET Framework 2.0 5 August 1st, 2006 03:38 PM
Converting an ASCII character to binary? skyraider Visual Basic 2005 Basics 0 May 7th, 2006 09:20 PM
Converting from binary to xml Morrislgn Pro VB.NET 2002/2003 0 February 2nd, 2006 12:46 PM
parseInt - sort ascending crmpicco Javascript How-To 3 July 5th, 2005 10:13 AM



All times are GMT -4. The time now is 10:30 AM.


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