Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - JAVA double computing method
JAVA double computing method
In java, the result type is .. The calculation expression is the largest of the expressions .. This is to avoid losing data. ..

For example, int+long result type is long. ..

Int+float result type is float. ..

The largest in the formula is long ... so the result is long ... so the calculated result will not be decimal ... but 0 ... and then assign the long integer 0 to double ... He will see if he can make it double ... Because double is bigger than long ... so it can ... become 0.0 ... If you assign it to an int, it will be compiled and made an error .. because he can't make it double. ..

So you need to convert a number into a double-precision number ... in the calculation. ..

(Unknown person time-start time) /86400000.0 So there is no problem. ..