Purpose of absolute value


I am a bit confused about integers and the usage of abs. Is the only purpose of abs(absolute value) in ruby is to simply make an integer positive?

Can it be compared to when you multiply a negative number to a negative number? Take for example in this case abs is a negative number, ( -5) * (abs) = 5 Abs would be say -1.


An absolute value is quite simple , its basic math its represented with these | | . its makes any negative integer become positive. for example

|-5| becomes 5 .... Once any negative integer get into these | | , it becomes positive ..
This operation doesn't affect positive numbers
|6| = 6
I hope you understand


Thank you for breaking it down!
Although | | is something I now need to google. You rock ayinmode!