by huherto · 16y ago · 0 comments
(max - min) is int
((long) key - min) is long
long / int is long since a long is involved.
(size - 1) is int
int * long is long
I think the purpose if the long cast is that the last multiplication produces a long and it doesn't overflow. But then it is casted to an int anyway defeating the purpose.Incorrect. These are signed values. If you subtract a large negative integer from a large positive integer, the result is larger than an integer.