Implement log1pf correctly rounded to all rounding modes relying on logf implementation for exponent > 2^(-8).
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I get several warnings when I compile this version:
In file included from /localdisk/zimmerma/llvm-project/libc/src/stdlib/strtold.cpp:11: In file included from /localdisk/zimmerma/llvm-project/libc/src/__support/str_to_float.h:16: /localdisk/zimmerma/llvm-project/libc/src/__support/high_precision_decimal.h:115:42: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'uint32_t' (aka 'unsigned int') [-Wsign-compare] if (roundToDigit < 0 || roundToDigit >= this->num_digits) { ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~ /localdisk/zimmerma/llvm-project/libc/src/__support/high_precision_decimal.h:121:26: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare] roundToDigit + 1 == this->num_digits) { ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
Comment Actions
apart the compiler warnings, all exhaustive tests comparing to MPFR do pass, for all four rounding modes. Good work!
Comment Actions
We are in the process of cleaning up the project to build with gcc. Thess warnings will be fixed soon.
Comment Actions
These warnings are caused by https://reviews.llvm.org/D118791 and being fixed by https://reviews.llvm.org/D119156
Comment Actions
overall LGTM with minor nit
libc/src/math/generic/log1pf.cpp | ||
---|---|---|
33 | should this be in common_constants.cpp? |
should this be in common_constants.cpp?