mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Minor cleanup
This commit is contained in:
@ -1038,11 +1038,11 @@ void fallback_format(Double d, buffer<char>& buf, int& exp10) {
|
|||||||
|
|
||||||
// Formats value using the Grisu algorithm
|
// Formats value using the Grisu algorithm
|
||||||
// (https://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf)
|
// (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>
|
template <typename T>
|
||||||
int format_float(T value, int precision, float_spec spec, buffer<char>& buf) {
|
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>(), "");
|
static_assert(!std::is_same<T, float>(), "");
|
||||||
|
FMT_ASSERT(value >= 0, "value is negative");
|
||||||
|
|
||||||
const bool fixed = spec.format == float_format::fixed;
|
const bool fixed = spec.format == float_format::fixed;
|
||||||
if (value <= 0) { // <= instead of == to silence a warning.
|
if (value <= 0) { // <= instead of == to silence a warning.
|
||||||
|
Reference in New Issue
Block a user