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

Method setCoefficient

decimal.go:240–245  ·  view source on GitHub ↗

setCoefficient sets d's coefficient and negative value to x and its Form to Finite The exponent is not changed. Since the exponent is not changed (and this is thus easy to misuse), this is unexported for internal use only.

(x int64)

Source from the content-addressed store, hash-verified

238// to Finite The exponent is not changed. Since the exponent is not changed
239// (and this is thus easy to misuse), this is unexported for internal use only.
240func (d *Decimal) setCoefficient(x int64) {
241 d.Negative = x < 0
242 d.Coeff.SetInt64(x)
243 d.Coeff.Abs(&d.Coeff)
244 d.Form = Finite
245}
246
247// SetFloat64 sets d's Coefficient and Exponent to x and returns d. d will
248// hold the exact value of f.

Callers 3

LnMethod · 0.95
ExpMethod · 0.95
SetFiniteMethod · 0.95

Calls 2

SetInt64Method · 0.45
AbsMethod · 0.45

Tested by

no test coverage detected