change int to float for precise calculation