division problems

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-06-10T17:54:33Z Indexed on 2010/06/10 18:02 UTC
Read the original article Hit count: 149

Filed under:
|
|

This line of code:

System.out.println ("aray[j], "+aray[j]+", divided by sum, "+sum+", equals: aray[j]/sum: "+ aray[j]/sum) ;

is yeilding this line of text:

aray[j], 21, divided by sum, 100, equals: aray[j]/sum: 0

why is it doing this? (everything is right eccept that the answer should be .21)

© Stack Overflow or respective owner

Related posts about java

Related posts about math