Casting the i to double before multiplying.

To avoid int overflow.