(rat *big.Rat, negZero bool)
| 1123 | } |
| 1124 | |
| 1125 | func finiteFloatRatString(rat *big.Rat, negZero bool) (string, bool) { |
| 1126 | if negZero { |
| 1127 | return "-0.0", true |
| 1128 | } |
| 1129 | decimal, ok := canonicalDecimalFromRat(rat) |
| 1130 | if !ok { |
| 1131 | return "", false |
| 1132 | } |
| 1133 | text, ok := canonicalDecimalString(decimal) |
| 1134 | if !ok { |
| 1135 | return "", false |
| 1136 | } |
| 1137 | if !strings.Contains(text, ".") { |
| 1138 | text += ".0" |
| 1139 | } |
| 1140 | return text, true |
| 1141 | } |
| 1142 | |
| 1143 | func pow10Int(exp int64) *big.Int { |
| 1144 | return new(big.Int).Exp(big.NewInt(10), big.NewInt(exp), nil) |
no test coverage detected