Method: Decimal#abs
- Defined in:
- lib/decimal/decimal.rb
#abs(context = nil) ⇒ Object
Absolute value
1578 1579 1580 1581 1582 1583 1584 |
# File 'lib/decimal/decimal.rb', line 1578 def abs(context=nil) if special? ans = _check_nans(context) return ans if ans end sign<0 ? _neg(context) : _pos(context) end |