[llvm] [Support][APInt] Fix sign extension, exponent and mantissa in APInt::roundToDouble (PR #192451)

Max Graey via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 08:10:15 PDT 2026


MaxGraey wrote:

I think it would be better to rewrite this function from scratch. It has several issues, the main one is that exact integer should round to the nearest representable double (with ties to even) but not it just chops extra low bits (trunc). Even better to add a few rounding options as an optional enum argument.

https://github.com/llvm/llvm-project/pull/192451


More information about the llvm-commits mailing list