| 1181 | |
| 1182 | public: |
| 1183 | float_writer(const char* digits, int num_digits, int exp, float_specs specs, |
| 1184 | Char decimal_point) |
| 1185 | : digits_(digits), |
| 1186 | num_digits_(num_digits), |
| 1187 | exp_(exp), |
| 1188 | specs_(specs), |
| 1189 | decimal_point_(decimal_point) { |
| 1190 | int full_exp = num_digits + exp - 1; |
| 1191 | int precision = specs.precision > 0 ? specs.precision : 16; |
| 1192 | if (specs_.format == float_format::general && |
| 1193 | !(full_exp >= -4 && full_exp < precision)) { |
| 1194 | specs_.format = float_format::exp; |
| 1195 | } |
| 1196 | size_ = prettify(counting_iterator()).count(); |
| 1197 | size_ += specs.sign ? 1 : 0; |
| 1198 | } |
| 1199 | |
| 1200 | size_t size() const { return size_; } |
| 1201 | size_t width() const { return size(); } |
nothing calls this directly
no test coverage detected