MCPcopy
hub / github.com/shopspring/decimal / Neg

Method Neg

decimal.go:548–555  ·  view source on GitHub ↗

Neg returns -d.

()

Source from the content-addressed store, hash-verified

546
547// Neg returns -d.
548func (d Decimal) Neg() Decimal {
549 d.ensureInitialized()
550 val := new(big.Int).Neg(d.value)
551 return Decimal{
552 value: val,
553 exp: d.exp,
554 }
555}
556
557// Mul returns d * d2.
558func (d Decimal) Mul(d2 Decimal) Decimal {

Callers 9

TestDecimal_NegFromEmptyFunction · 0.95
AtanMethod · 0.95
SinMethod · 0.95
CosMethod · 0.95
TanMethod · 0.95
TestNewFromBigRatFunction · 0.80
TestDecimal_NegFunction · 0.80
NewFromFloatWithExponentFunction · 0.80

Calls 1

ensureInitializedMethod · 0.95

Tested by 4

TestDecimal_NegFromEmptyFunction · 0.76
TestNewFromBigRatFunction · 0.64
TestDecimal_NegFunction · 0.64