Skip to content

Commit 6e837dc

Browse files
committed
Add deprecation message to trunc_to
1 parent ca66d89 commit 6e837dc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/boost/decimal/detail/cmath/rescale.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ constexpr auto rescale(T val, int precision = 0) noexcept
6464
return {sig, exp, isneg};
6565
}
6666

67+
BOOST_DECIMAL_EXPORT template <typename T>
68+
[[deprecated("Renamed to rescale to match existing literature")]]
69+
constexpr auto trunc_to(T val, int precision = 0) noexcept
70+
BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
71+
{
72+
return rescale(val, precision);
73+
}
74+
6775
} // namespace decimal
6876
} // namespace boost
6977

0 commit comments

Comments
 (0)