Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Division question

843785Feb 24 2009 — edited Feb 24 2009
Hi, I am very new to java and I have a simple question about the division operator.

I would like to find the decimal number of x/y, where x<=y. When I try this,
double result = x/y; 
I get zero. Is there something I am missing, does the division operator automatically floor/ceiling it? If it does, how would I do what I want?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2009
Added on Feb 24 2009
4 comments
173 views