What does "some error" mean? We can't "solve this issue" if you do not explain what it is.

The code you posted will produce 1.0, 5.0, and 25.0, which is correct.