Strange output, but why and how to solve it

PaulS:
Doesn't look to me like it "returns" a float.

Apparently not - odd, masking the gcc round. Solution now then would appear to be to use %ld rather than %d.