Why basic data structure knowledge is important.

Today while working through an issue ticket we came across a situation where console.log() was printing out a rounded variation of an integer. The server response payload was correct, the client was receiving the correct payload. But when the data was processed a rounded variation of the data point was being returned.

http://www.studytonight.com/data-structures/images/introduction-to-data-structures.gif

After a short amount of digging we found that my initial hunch was close: it is a character length limit of the language.  Basic data structure and computer science understanding is in fact useful to be familiar with.

References:

http://stackoverflow.com/questions/1379934/large-numbers-erroneously-rounded-in-javascript

http://www.ecma-international.org/ecma-262/5.1/#sec-8.5

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.