[all-commits] [llvm/llvm-project] 8ca565: [libc] Fix printf long double truncation bound (#7...

michaelrj-google via All-commits all-commits at lists.llvm.org
Mon Oct 30 14:04:14 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8ca565cd3b68929c0691fd97a6d0f7a52d3e3cd7
      https://github.com/llvm/llvm-project/commit/8ca565cd3b68929c0691fd97a6d0f7a52d3e3cd7
  Author: michaelrj-google <71531609+michaelrj-google at users.noreply.github.com>
  Date:   2023-10-30 (Mon, 30 Oct 2023)

  Changed paths:
    M libc/src/stdio/printf_core/float_dec_converter.h
    M libc/test/src/stdio/sprintf_test.cpp

  Log Message:
  -----------
  [libc] Fix printf long double truncation bound (#70705)

The calculation for if a number being printed is truncated and should be
rounded up assumed a double for one of its constants, causing
occassional misrounding. This fixes that by making the constant based on
the mantissa width.




More information about the All-commits mailing list