See Conversions

I recently 1 stumbled across an interesting C function. The function was quite simple&ndash;just a few lines long&mdash;so I was sure I understood it. And yet, the function produced unexpected results&mdash;and I could not understand why. Debugging this tiny function led me down the dark hole that is implicit type conversions in C. I have reproduced the function in its entirety below (with a…