Integer to double conversion

As I said, I'm not sure how to explain. But your code demonstrates what I wanted to convey.