Skip to content

Instantly share code, notes, and snippets.

@Maslor
Created August 6, 2015 22:24
Show Gist options
  • Save Maslor/bca02d0110ffcfefb6e2 to your computer and use it in GitHub Desktop.
Save Maslor/bca02d0110ffcfefb6e2 to your computer and use it in GitHub Desktop.
return the symmetric of a positive number. Negative numbers aren't altered
public class Negative {
public static int makeNegative(final int x) {
if(x >= 0) return -x;
else return x;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment