A strange print function bug
<p>I'm working on a InterviewStreet problem <a href="https://www.interviewstreet.com/challenges/dashboard/#problem/4fcf919f11817" rel="nofollow">https://www.interviewstreet.com/challenges/dashboard/#problem/4fcf919f11817</a>, the algorithm is correct but I still get several wrong answers, after several hours I find the problem is related with a print function:</p>

<pre><code>void printHalf(int64_t x) {
    if (x % 2 == 0)
        printf("%lld\n", x / 2L);
    else
        printf("%lld.5\n", x / 2L);
}
</code></pre>

<p>This function takes a 64-bit integer, and print its half. If I change this function to the following code, my solution works on all test cases:</p>

<pre><code>void printHalf(int64_t x) {
    if (x % 2 == 0)
        printf("%lld\n", x / 2L);
    else
        printf("%.1f\n", x / 2.0);
}
</code></pre>

<p>It looks a little weird to me, since in my opinion the two functions have the same results.</p>
