Answer the question
In order to leave comments, you need to log in
Why do we get such output to the console when executing this code?
Why do we get zero with a minus sign when we multiply a negative double or float number by zero?
double x = -1;
x *= 0;
System.out.print(x);
stdout
-0.0
float x = -1f;
x *= 0;
System.out.print(x);
stdout
-0.0
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