method

abs

v2_6_3 - Show latest stable - Class: Integer
abs()
public

Returns the absolute value of int.

(-12345).abs   #=> 12345
-12345.abs     #=> 12345
12345.abs      #=> 12345

Integer#magnitude is an alias for Integer#abs.