-
Notifications
You must be signed in to change notification settings - Fork 62
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
How to use as scaled decimal number (1.x) #991
Comments
Hi. Thanks for filing this issue. It has since been addressed in the latest version:
The specialisation that was provided in v1 is likely to be using a bit shift operation and so only works for the binary base. |
Still in v1 since the C++17 we used. namespace cnl {
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>();
}
};
} Could you please help me to review these code?
|
Hi. Thanks for the feedback and suggestion. I should be able to take a look at it later today. The great thing about DVCS and CI is that you can safely break things without causing harm or disruption to others. So while I'm happy to help, you don't have to wait.
|
CI for v1.x is not currently working, likely due to updates to the docker images used to build the project. I'll need to fix the v1.x branch first. |
After one years I retry to fix this issue, and there still some bug I cannot fixed. (I made a pull request into 991 branch it into branch) After reading the code in project, I found out the design-rule of So It may more suitable to move into https://github.com/johnmcfarlane/cnl/blob/991/include/cnl/rounding_integer.h#L74 There's some problem on test like And conan in pip has been updated into 2.0, but a lot of package hasn't upgraded in there repo. |
Co-authored-by: vrqq <[email protected]>
When I try to use this code below, the complier error occurred when
std::cout
.Clang 12 with libstdc++ and c++ 17
Then I check the source code at: cnl/rounding_integer.h:63
I am confusing that why can't be
default_scale<(Digits < 0), (Radix != 2)>
?(tag v1.7, also v1.x branch currently)
cnl/include/cnl/rounding_integer.h
Lines 57 to 73 in 2dde6e6
The text was updated successfully, but these errors were encountered: