I would like to know if there is any method to save the whole part of a float type variable in another Integer variable. I've been looking and I have not found anything, I'm there with the doubt. Greetings!
I would like to know if there is any method to save the whole part of a float type variable in another Integer variable. I've been looking and I have not found anything, I'm there with the doubt. Greetings!
It is enough that you make a casting of the variable to its corresponding type of data in this case be an int or a long
Example
Float a whole
float real = 14.444f;
int entero = (int)real;
Double to whole
double real = 14.444;
int entero = (int)real;
The same applies for the long