In my code i have following line.
double temp=(c12*fileSize);
- Here c12 is double and fileSizeis double
- c12 have a value 1700 and
- fileSize have a value 1944038
but after multiplication i am getting -990102696.
Can any one help me on it? Is that some size limits went wrong?
Your c12 and fileSize are most likely ints (+1 Tomasz). Java multiplies the ints, which overflows, becoming negative, and then stores that negative value in your double. Cast c12 and fileSize to double before multiplying:
produces: