- http://forum.java.sun.com/thread.jspa?threadID=609720
Solution:
int d = (int) x;
or an alternative method
int d = (int) Math.floor(x);
For example, if x was 2.75, with this method d would be 2. We can think about it as if the decimal digits were taken away.
No hay comentarios:
Publicar un comentario