Answer the question
In order to leave comments, you need to log in
Different output result for the same variable. What is the salt?
double x = 8.8;
double y = 1.5;
double z = x -y;
System.out.printf("Result: %f", z);//Результат: 7,300000
System.out.println(z); //Результат: 7.300000000000001
float x1 = 8.8f;
float y1 = 1.5f;
float z1 = x1 - y1;
System.out.printf("Result: %f", z1);//Результат: 7,300000
System.out.println(z1); //Результат: 7.3
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