[libc-commits] [PATCH] D144597: [libc] Refactor string to float return values
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Feb 27 06:30:46 PST 2023
lntue added inline comments.
================
Comment at: libc/src/__support/high_precision_decimal.h:391-394
+ if (this->should_round_up(this->decimal_point, round)) {
++result;
}
return result;
----------------
nit: for performance purpose, this could be changed to:
```
return result + this->should_round_up(this->decimal_point, round)
```
which is well-defined behavior and branchless.
================
Comment at: libc/src/__support/str_to_float.h:28
+template <class T> struct FloatPair {
+ typename fputil::FPBits<T>::UIntType mantissa;
----------------
sivachandra wrote:
> michaelrj wrote:
> > sivachandra wrote:
> > > Bikeshed: s/`FloatPair`/`FloatComponents` ?
> > I like `FloatPair` better, personally, but it doesn't really matter to me.
> My concern is that `FloatPair` sounds like it holds two floating point values.
I agree that `FloatPair` name is a bit confusing, but other name that I can come up with is `ExpMant`, which might not be better,
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144597/new/
https://reviews.llvm.org/D144597
More information about the libc-commits
mailing list