Rediculous problem?! Assigning a fraction to a double variable
I'm having trouble with a rediculous problem; an extrodinarily simple assignment and or creation statement.
Basically i can't get my type double variable to equal a simple fraction like 1/6,
however rediculous that may sound even worse so is the fact that there's a working double using more complex variables just above it in the code.
I've tried just about every work round i could think of to make this go but i'm still getting the same stupid results.
double temp = 0;
for (int i = 0; i < intDrawn; i++)
temp += 1/(Double.valueOf(Integer.toString(intBalls))-i);
}//end for loop
dblWin = 1-temp/intDrawn;
double temp2 = 1/6; //1/dblWin;
System.out.println("temp2 " + temp2);
dblLose = Math.pow(temp2, (1/6));
As u can see in the for loop i had already had some trouble with the double variable befor however i found a work around that worked.
Any insight into the problem and or solution would be appreciated.