Calling java.lang.Integer.signum and casting primitives directly for speed.