Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logarithmic funcs #536

Merged
merged 5 commits into from
May 5, 2024
Merged

Logarithmic funcs #536

merged 5 commits into from
May 5, 2024

Conversation

ckormanyos
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented May 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.8%. Comparing base (84785bf) to head (a001179).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #536     +/-   ##
=========================================
+ Coverage     98.8%   98.8%   +0.1%     
=========================================
  Files          186     188      +2     
  Lines        11631   11653     +22     
=========================================
+ Hits         11482   11509     +27     
+ Misses         149     144      -5     
Files Coverage Δ
...lude/boost/decimal/detail/cmath/impl/cosh_impl.hpp 100.0% <ø> (ø)
...ude/boost/decimal/detail/cmath/impl/log1p_impl.hpp 100.0% <100.0%> (ø)
...clude/boost/decimal/detail/cmath/impl/log_impl.hpp 100.0% <100.0%> (ø)
...lude/boost/decimal/detail/cmath/impl/sinh_impl.hpp 100.0% <ø> (ø)
...lude/boost/decimal/detail/cmath/impl/tanh_impl.hpp 100.0% <ø> (ø)
include/boost/decimal/detail/cmath/log.hpp 95.5% <100.0%> (+2.9%) ⬆️
include/boost/decimal/detail/cmath/log1p.hpp 100.0% <100.0%> (+9.1%) ⬆️
test/test_log.cpp 100.0% <100.0%> (+2.9%) ⬆️
test/test_log1p.cpp 100.0% <100.0%> (+1.3%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84785bf...a001179. Read the comment docs.

@ckormanyos
Copy link
Collaborator Author

This PR is intended to address #534 and #535

@ckormanyos ckormanyos merged commit 9ea4614 into develop May 5, 2024
61 checks passed
@ckormanyos ckormanyos deleted the logarithmic_funcs branch May 5, 2024 19:24
Comment on lines -169 to -188
BOOST_DECIMAL_EXPORT template <typename T>
constexpr auto log(T x) noexcept
BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
{
#if BOOST_DECIMAL_DEC_EVAL_METHOD == 0

using evaluation_type = T;

#elif BOOST_DECIMAL_DEC_EVAL_METHOD == 1

using evaluation_type = detail::promote_args_t<T, decimal64>;

#else // BOOST_DECIMAL_DEC_EVAL_METHOD == 2

using evaluation_type = detail::promote_args_t<T, decimal128>;

#endif

return static_cast<T>(detail::log_impl(static_cast<evaluation_type>(x)));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep this part on each of the special functions to properly support the float evaluation methods. This promotes the type of x depending on the macro set and then does the calculation much like how boost math does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants