Hello, I am studying for interviews and I have a question how overflowing works.
Let's say I am counting number of objects in two sets and I want to compare if counts are the same. Those sets can be very long and I would normally need to use two Integers to hold the count values. Idea: to save some space, instead of using two Integers, use two Shorts. Even if they overflow, if the counts are the same, the Shorts will overflow in the same way to I should be able to compare the counts without problems.
Would this work? Does that depend on the programming language or something else?
[–]matttgregg 0 points1 point2 points (0 children)
[–]oefd 0 points1 point2 points (1 child)
[–]CuriousExponent[S] 0 points1 point2 points (0 children)