Skip to content

Instantly share code, notes, and snippets.

@rodrei
Created November 24, 2011 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodrei/1391958 to your computer and use it in GitHub Desktop.
Save rodrei/1391958 to your computer and use it in GitHub Desktop.
num = Math.abs(num)
// Java code
num = -1234
positive = num.abs
# => 1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment