Let me try to break it down:
(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.