I think you print the output using the '%g".Use "%f " and try .You will get a understandable output.