[libc-commits] [PATCH] D143006: [libc] add printf auto float conversion

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jan 31 11:38:51 PST 2023


michaelrj created this revision.
michaelrj added reviewers: sivachandra, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
michaelrj requested review of this revision.

This patch adds the final conversion to printf, %g. This is a floating
point conversion that selects automatically between the %e and %f
formats based on the precision requested and resulting exponent.
Additionally it trims trailing zeroes. With this done all that's left
for finishing printf is adding long double support to the decimal float
conversions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143006

Files:
  libc/src/stdio/printf_core/converter.cpp
  libc/src/stdio/printf_core/converter_atlas.h
  libc/src/stdio/printf_core/float_dec_converter.h
  libc/test/src/stdio/sprintf_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143006.493696.patch
Type: text/x-patch
Size: 47061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230131/75150d67/attachment-0001.bin>


More information about the libc-commits mailing list