About this question
Medium · Code Analysis · Quant Trader interview question · floating-point, numerical-analysis, precision, summation
A junior quant analyst is tasked with summing 10 million values, each equal to 0.1, using a standard floating-point representation (e.g., a float or double in Python or C++). Intuitively, the result should be exactly 1,000,000. However, when the analyst runs the code, the result is slightly different. What is the MOST likely reason for this discrepancy?