mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-07 08:31:16 +00:00
Minor cleanup
This commit is contained in:
parent
28d7191c27
commit
75fff1db64
@ -1038,11 +1038,11 @@ void fallback_format(Double d, buffer<char>& buf, int& exp10) {
|
||||
|
||||
// Formats value using the Grisu algorithm
|
||||
// (https://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf)
|
||||
// if Float is a IEEE754 binary32 or binary64 and snprintf otherwise.
|
||||
// if T is a IEEE754 binary32 or binary64 and snprintf otherwise.
|
||||
template <typename T>
|
||||
int format_float(T value, int precision, float_spec spec, buffer<char>& buf) {
|
||||
FMT_ASSERT(value >= 0, "value is negative");
|
||||
static_assert(!std::is_same<T, float>(), "");
|
||||
FMT_ASSERT(value >= 0, "value is negative");
|
||||
|
||||
const bool fixed = spec.format == float_format::fixed;
|
||||
if (value <= 0) { // <= instead of == to silence a warning.
|
||||
|
Loading…
Reference in New Issue
Block a user