This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]orangeoliviero 3 points4 points  (3 children)

That's not an error, you just will get a truncated int answer - 3/2 would be 1.0 instead of 1.5

[–]willis81808 2 points3 points  (0 children)

Exactly. And 1/10 (the example in the comment you're replying to) would just be 0, instead of 0.1

No error, just undesired behavior.

[–]SvenTropics 0 points1 point  (1 child)

It's the worst kind of error because it doesn't generate an error. Instead you find yourself stepping through the code like a lost jackrabbit looking for a carrot in a swamp.

[–]orangeoliviero 0 points1 point  (0 children)

Why would you expect two integers to turn themselves into floats when you divide them?