MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / float_writer

Method float_writer

extlibs/fmt/include/fmt/format.h:1183–1198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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(); }

Callers

nothing calls this directly

Calls 2

counting_iteratorClass · 0.85
countMethod · 0.45

Tested by

no test coverage detected