I am trying to divide two numbers in java - more specifically I have the fraction 800/9177 and want to convert it to a double or float or w/e. My problem is when I try to get the value of the fraction, I get 0.
Anybody knows how to do this?
my code:
double dt = 800/9177;
float ft = 800/9177;
double dw = 800/122;
System.out.println("dt : " + dt + " ft: " + ft + " dw " + dw + " 800/9177 " + (800/9177));
it prints dt: 0 ft: 0 dw : 6.0 800/9177 0 so all my fractions except for dw is 0.