title: Can we say that it's always true that 0.5*x + 0.5*x == x?
body: <p><code>0.5</code> is a (negative) power of <code>2</code>, which means it is exactly representable by the <em>IEEE-754 binary floating-point format</em>. In signle precision it is <code>0'01111110'00000000000000000000000</code>.</p>
  
  <p>Based on my quick tests with optimizations turned off (<code>-O0</code>), it turns out that if <code>y = 0.5 * x</code>, then <code>y + y == x</code>. But is it always guaranteed by the IEEE-754 standard?</p>
  
  <p>I know that in general if <code>n</code> is a positive integer power of <code>2</code>, and <code>m = 1.0 / n</code>, <code>y = m * x</code>, then adding <code>y</code> together <code>n</code> times doesn't produce <code>x</code>. But it seems that with <code>n = 2</code> yes.</p>
  
  <p>Do I miss something?</p>