NewWithBigInt creates a new decimal with the given coefficient and exponent.
(coeff *BigInt, exponent int32)
| 85 | |
| 86 | // NewWithBigInt creates a new decimal with the given coefficient and exponent. |
| 87 | func NewWithBigInt(coeff *BigInt, exponent int32) *Decimal { |
| 88 | d := new(Decimal) |
| 89 | d.Coeff.Set(coeff) |
| 90 | if d.Coeff.Sign() < 0 { |
| 91 | d.Negative = true |
| 92 | d.Coeff.Abs(&d.Coeff) |
| 93 | } |
| 94 | d.Exponent = exponent |
| 95 | return d |
| 96 | } |
| 97 | |
| 98 | func consumePrefix(s, prefix string) (string, bool) { |
| 99 | if strings.HasPrefix(s, prefix) { |
searching dependent graphs…