how to cast convert double to float and long to int?