Decimals in java help!!
i need some help with java
ive got an assignment and 1 of the questions is 22 divided by 1000000 see i no the answer is 0.000022 but everytime i try it in bluej i keep gettin the answer as 0.0 ive tried float and double could anyone suggest another way for me to get my answer showing correctly
Your problem is that you're doing int division which always results in an int. try dividing 1.0 by 22.0
ok i tried that and it did not work :(
thanks for ur help
Well, my suggestion works, but without seeing your code, we'll have no idea what you're doing wrong.
Originally Posted by Gold