We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There is no such thing as decimal integers. Decimal values are NOT integers, they are called floating point values and are stored in memory through approximation unlike integers which are exact values.
This is very important to understand and remember because this is exactly the reason why you never ever ever use decimal/floating point variables to store or calculate values of high precision such as currency because the approximations which are floating point values can result in arithmetic error when many calculations are performed.
The reason I'm leaving this comment is not to be arrogant but to make a point that there is a fundamental difference in the way integers are stored in memory and if you want to save yourself hours of wasted time looking for devious bugs, read up about these differences.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Maximizing XOR
You are viewing a single comment's thread. Return to all comments →
There is no such thing as decimal integers. Decimal values are NOT integers, they are called floating point values and are stored in memory through approximation unlike integers which are exact values.
This is very important to understand and remember because this is exactly the reason why you never ever ever use decimal/floating point variables to store or calculate values of high precision such as currency because the approximations which are floating point values can result in arithmetic error when many calculations are performed.
The reason I'm leaving this comment is not to be arrogant but to make a point that there is a fundamental difference in the way integers are stored in memory and if you want to save yourself hours of wasted time looking for devious bugs, read up about these differences.