Neg sets d to -x and returns d.
(x *Decimal)
| 685 | |
| 686 | // Neg sets d to -x and returns d. |
| 687 | func (d *Decimal) Neg(x *Decimal) *Decimal { |
| 688 | d.Set(x) |
| 689 | if d.IsZero() { |
| 690 | d.Negative = false |
| 691 | } else { |
| 692 | d.Negative = !d.Negative |
| 693 | } |
| 694 | return d |
| 695 | } |
| 696 | |
| 697 | // Abs sets d to |x| and returns d. |
| 698 | func (d *Decimal) Abs(x *Decimal) *Decimal { |