MCPcopy Create free account
hub / github.com/cockroachdb/apd / Neg

Method Neg

context.go:194–201  ·  view source on GitHub ↗

Neg sets d to -x.

(d, x *Decimal)

Source from the content-addressed store, hash-verified

192
193// Neg sets d to -x.
194func (c *Context) Neg(d, x *Decimal) (Condition, error) {
195 if c.shouldSetAsNaN(x, nil) {
196 return c.setAsNaN(d, x, nil)
197 }
198 d.Neg(x)
199 res := c.round(d, d)
200 return c.goError(res)
201}
202
203// Mul sets d to the product x*y.
204func (c *Context) Mul(d, x, y *Decimal) (Condition, error) {

Callers 1

addMethod · 0.45

Calls 4

shouldSetAsNaNMethod · 0.95
setAsNaNMethod · 0.95
roundMethod · 0.95
goErrorMethod · 0.95

Tested by

no test coverage detected