[PATCH] D145277: [support] Support printing floats in ScopedPrinter
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 20 02:42:33 PDT 2023
jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.
Looks good, but see inline comment for possible suggestion.
================
Comment at: llvm/unittests/Support/ScopedPrinterTest.cpp:605
+float-42.5625: 42.6
+double-max: 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
+double-min: 0.0
----------------
Just a thought, but this value is implementation defined ultimately. I'm not suggesting necessarily changing this, but if you don't, you should keep a close eye on CI after landing this in case it doesn't work for a particularly system.
The alternative would be to build this string up dynamically, using `std::to_string` on the same values as the ones passed to `printNumber`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145277/new/
https://reviews.llvm.org/D145277
More information about the llvm-commits
mailing list