Answer the question
In order to leave comments, you need to log in
Why is the double value not exact?
When increasing the value of double, floating point values are not exact, for example:
public class Main{
static double ii = 0;
public static void main(String[] args) {
for (double i = 0; i <= 10; i+=0.000_001) {
ii+=0.000_001;
}
System.out.println(ii);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question