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)
| 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. |
| 240 | func (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. |