424 changes: 424 additions & 0 deletions libc/src/__support/float_to_string.h

Large diffs are not rendered by default.

4,399 changes: 4,399 additions & 0 deletions libc/src/__support/ryu_constants.h

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions libc/src/stdio/printf_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ add_object_library(
write_int_converter.h
float_inf_nan_converter.h
float_hex_converter.h
float_dec_converter.h
DEPENDS
.writer
.core_structs
Expand All @@ -67,7 +68,10 @@ add_object_library(
libc.src.__support.CPP.string_view
libc.src.__support.FPUtil.fp_bits
libc.src.__support.FPUtil.fenv_impl
libc.src.__support.uint
libc.src.__support.uint128
libc.src.__support.integer_to_string
libc.src.__support.float_to_string
)


Expand Down
6 changes: 3 additions & 3 deletions libc/src/stdio/printf_core/converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ int convert(Writer *writer, const FormatSection &to_conv) {
case 'X':
return convert_int(writer, to_conv);
#ifndef LLVM_LIBC_PRINTF_DISABLE_FLOAT
// case 'f':
// case 'F':
// return convert_float_decimal(writer, to_conv);
case 'f':
case 'F':
return convert_float_decimal(writer, to_conv);
// case 'e':
// case 'E':
// return convert_float_dec_exp(writer, to_conv);
Expand Down
1 change: 1 addition & 0 deletions libc/src/stdio/printf_core/converter_atlas.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#ifndef LLVM_LIBC_PRINTF_DISABLE_FLOAT
// defines convert_float_decimal
#include "src/stdio/printf_core/float_dec_converter.h"
// defines convert_float_dec_exp
// defines convert_float_hex_exp
#include "src/stdio/printf_core/float_hex_converter.h"
Expand Down
480 changes: 480 additions & 0 deletions libc/src/stdio/printf_core/float_dec_converter.h

Large diffs are not rendered by default.

582 changes: 581 additions & 1 deletion libc/test/src/stdio/sprintf_test.cpp

Large diffs are not rendered by default.