Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Accuracy of JAVA decimal division
Accuracy of JAVA decimal division
Because int

Is an integer, and an integer divided by an integer is an integer.

Double is a decimal. Decimal is a decimal other than decimal.

There are two ways,

1. is directly divided by the decimal.

Such as 3.0/5.0

So the compiler will think they are double-precision types.

2. Is it converted into double or directly defined as double?

Like double

a = 3;

double;twofold

b = 5;

system . out . println(3/5);

If you don't understand anything, you can ask me.