Skip to content

Commit

Permalink
911 fix supplied by @vrqq
Browse files Browse the repository at this point in the history
  • Loading branch information
John McFarlane committed Dec 22, 2023
1 parent d6db50e commit a2ee3d4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/cnl/_impl/num_traits/scale.h
Expand Up @@ -46,6 +46,18 @@ namespace cnl {
: _impl::default_scale<Digits, Radix, S> {
};

template<int Digits, int Radix, template<typename, typename>
class TNUM, typename S, typename Tag>
struct scale<Digits, Radix, TNUM<S, Tag>, _impl::enable_if_t<(
Digits<0 && cnl::_impl::is_integral<S>::value)>>
{
CNL_NODISCARD constexpr auto operator()(TNUM<S, Tag> const& s) const
-> decltype(s/_impl::power_value<S, -Digits, Radix>())
{
return s/_impl::power_value<S, -Digits, Radix>();
}
};

namespace _impl {
// cnl::_impl::scale - convenience wrapper for cnl::scale
template<int Digits, int Radix=2, class S>
Expand Down

0 comments on commit a2ee3d4

Please sign in to comment.