When I add 1/3 and 2/3 in double precision, I ended up with $1.\boxed{111\ldots1}1\times2^{-1}$, where the boxed part is the 52-bit mantissa. By the rounding to even rule, I should round it up, right? So is it true if I get $10.\boxed{000\ldots0}\times2^{-1}=1.\boxed{000\ldots0}$ as the final answer?
1/3+2/3 in double precision
2
$\begingroup$
computer-science
numerical-methods
arithmetic
-
0In general, if you cannot be sure of the correctness of your own calculation, one of the good ways to check the correctness is by writing down steps more carefully. In your case, the first step is to represent 1/3 and 2/3 as double-precision floating-point numbers. – 2012-02-16