I\'m currently coding a little download manager and I get a funny output when I try to calculate the download-progress in percent. This is what i use to calculate it:
You should use a long -- 2147760000 in binary is 10000000 00000100 00110111 10000000 and since the most significant bit is 1 it is interpreted as a negative number.