forked from boostorg/multiprecision
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ac4ed9
commit 37e28bf
Showing
12 changed files
with
217 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_floor.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/////////////////////////////////////////////////////////////////////////////// | ||
// Copyright Christopher Kormanyos 2024. | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
|
||
#ifndef BOOST_MP_CPP_DF_QF_DETAIL_CCMATH_FLOOR_2024_12_30_HPP | ||
#define BOOST_MP_CPP_DF_QF_DETAIL_CCMATH_FLOOR_2024_12_30_HPP | ||
|
||
#include <cmath> | ||
#include <type_traits> | ||
|
||
namespace boost { namespace multiprecision { namespace backends { namespace cpp_df_qf_detail { namespace ccmath { | ||
|
||
namespace detail { | ||
|
||
#if defined(BOOST_HAS_FLOAT128) | ||
template <class T> | ||
auto floor_impl(T x) -> typename ::std::enable_if<::std::is_same<T, ::boost::float128_type>::value, T>::type | ||
{ | ||
return ::floorq(x); | ||
} | ||
#endif | ||
|
||
template <class T> | ||
auto floor_impl(T x) -> typename ::std::enable_if<::std::is_floating_point<T>::value, T>::type | ||
{ | ||
// Default to the regular std::floor function. | ||
using std::floor; | ||
|
||
return floor(x); | ||
} | ||
|
||
} // namespace detail | ||
|
||
template <typename Real> | ||
auto floor(Real x) -> Real | ||
{ | ||
return cpp_df_qf_detail::ccmath::detail::floor_impl<Real>(x); | ||
} | ||
|
||
} } } } } // namespace boost::multiprecision::backends::cpp_df_qf_detail::ccmath | ||
|
||
#endif // BOOST_MP_CPP_DF_QF_DETAIL_CCMATH_FLOOR_2024_12_30_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.