How I know when divide some number the results is decimal ?

I am new programing in java, I looking for any instruction what tell me where I divide a number and the results is a decimal number like 2.5, 4.9, etc.
[158 byte] By [toreblaa] at [2007-10-3 5:39:22]
# 1
When dividing two numbers, if either number (or both) is a double (decimal), then the result will be a double.
CaptainMorgan08a at 2007-7-14 23:47:03 > top of Java-index,Java Essentials,New To Java...
# 2
Assuming you're working with a double, you could round it off using Math.rint and see if the rounded value is equal to the original value: If they differ then the original value is non-integral (i.e. is a decimal number).
Mr_Evila at 2007-7-14 23:47:03 > top of Java-index,Java Essentials,New To Java...
# 3
x % y > 0
kablaira at 2007-7-14 23:47:03 > top of Java-index,Java Essentials,New To Java...
# 4
Excuse me, Mr_Evil, but I am a new programer, I try to use that instruction, but I don't get it. Do you have some example about that instruction. I appreciate your efforts for me. Thanks
toreblaa at 2007-7-14 23:47:03 > top of Java-index,Java Essentials,New To Java...
# 5

> Excuse me, Mr_Evil, but I am a new programer, I try

> to use that instruction, but I don't get it. Do you

> have some example about that instruction. I

> appreciate your efforts for me.

>

> Thanks

This is what Mr_Evil meant:double originalValue = 0.0d;

for(int i = 0; i < 10; i++) {

originalValue += 0.1d;

}

// round originalValue to the closest (mathematical) integer

double roundedValue = Math.rint(originalValue);

System.out.println("Is the original value "+originalValue+

" an integer? "+(originalValue == roundedValue));

; )

prometheuzza at 2007-7-14 23:47:03 > top of Java-index,Java Essentials,New To Java...