| 93 | } |
| 94 | |
| 95 | void BasicDecimal32::GetWholeAndFraction(int scale, BasicDecimal32* whole, |
| 96 | BasicDecimal32* fraction) const { |
| 97 | DCHECK_GE(scale, 0); |
| 98 | DCHECK_LE(scale, kMaxScale); |
| 99 | |
| 100 | BasicDecimal32 multiplier(DecimalTraits<BasicDecimal32>::powers_of_ten()[scale]); |
| 101 | auto s = Divide(multiplier, whole, fraction); |
| 102 | DCHECK_EQ(s, DecimalStatus::kSuccess); |
| 103 | } |
| 104 | |
| 105 | const BasicDecimal32& BasicDecimal32::GetMaxValue() { |
| 106 | return DecimalTraits<BasicDecimal32>::kMaxValue; |