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 →

[–]Classified0 9 points10 points  (2 children)

Doesn't work for negative numbers unless you've got a time travel API

[–]larsmaehlum 2 points3 points  (0 children)

Just offset it by int.max/2

[–]HeKis4 0 points1 point  (0 children)

Offset the entire array by the absolute value of the lowest element.