Change double tmp to float tmp.