Fix for printing long doubles bug in dump_float (#3929)

This commit is contained in:
Kirill Lokotkov
2026-05-15 20:25:16 +03:00
committed by GitHub
parent bb5404bb86
commit b1bb9fce0c
3 changed files with 73 additions and 2 deletions
@@ -836,7 +836,7 @@ class serializer
static int snprintf_float(char* buf, std::size_t size, int d, long double x)
{
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
return (std::snprintf)(buf, size, "%.*lg", d, x);
return (std::snprintf)(buf, size, "%.*Lg", d, x);
}
void dump_float(number_float_t x, std::false_type /*is_ieee_single_or_double*/)