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

Method Copy

decimal.go:458–464  ·  view source on GitHub ↗

Copy returns a copy of decimal with the same value and exponent, but a different pointer to value.

()

Source from the content-addressed store, hash-verified

456
457// Copy returns a copy of decimal with the same value and exponent, but a different pointer to value.
458func (d Decimal) Copy() Decimal {
459 d.ensureInitialized()
460 return Decimal{
461 value: new(big.Int).Set(d.value),
462 exp: d.exp,
463 }
464}
465
466// rescale returns a rescaled version of the decimal. Returned
467// decimal may be less precise if the given exponent is bigger

Callers 2

LnMethod · 0.95
TestCopyFunction · 0.80

Calls 1

ensureInitializedMethod · 0.95

Tested by 1

TestCopyFunction · 0.64