Confused with C++ "simple" calculation with sign &
<p>I am looking at a C++ source code where there is what looks to be a simply calculation. Yet with no knowledge in C++, I can't quite understand how it is really calculated (my goal being making the same calculation under Excel).</p>

<pre><code>uint64_t fpo = (((ui&gt;&gt;32) &lt;&lt; 24) | (ui &amp; 0xffffff)) + 0x123e00;
PrintAndLog("ui result : %lld [0x%llX]", ui, ui);
</code></pre>

<p>In my case, ui is 0x0F007057B9
and the result is 0xF8295B9</p>

<p>If I take the windows Calculator, I do (in Hex mode) </p>

<pre><code>(0x0F007057B9 AND 0xffffff) + 0x123e00
</code></pre>

<p>I am getting the same result (expect for the first 0xF)</p>

<p>I have read somewhere that AND returns 1 if both bits of same "weigh" are 1
So if I take ui AND 0xffffff converted to Binary :</p>

<pre><code>0x0F007057B9 0000111100000000011100000101011110111001
0xffffff                     111111111111111111111111
-------------------------------------------------------
             0000111100000000011100000101011110111001
</code></pre>

<p>Which does make any change...</p>

<p>Am I completely going to wrong way?? Sorry for my poor english, I am from South Korea.
Thank you for helping me {^^;</p>