Varying behavior for possible loss of precision

Posted by szupie on Stack Overflow See other posts from Stack Overflow or by szupie
Published on 2010-04-23T07:08:44Z Indexed on 2010/04/23 7:33 UTC
Read the original article Hit count: 239

Filed under:
|

In Java, when you do

int b;
b = b + 1.0;

You get a possible loss of precision error. But why is it that if you do

int b;
b += 1.0;

There isn't any error?

© Stack Overflow or respective owner

Related posts about java

Related posts about precision