Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In java, how to judge whether a number is an integer?
In java, how to judge whether a number is an integer?
if(z == int (z)){

Prt ("plastic surgery")

}

or

Integer/Integer = Integer

So the result z must be an integer and no judgment is needed.

But if you want to judge, you can do this.

z =(L-x+y)/(n-m);

temp =(L-x+y)/(float)(n-m);

At this time, judge (temp & gtz)? That's it.