Gennaro Prota:
Am I missing something?
Yes. I have, in fact, previously explained how to use choose_n correctly.
Please read more carefully. If something doesn't appear to make sense,
reconsider your basic assumptions. Only after you have carefully
reconsidered your assumptions, should you
Hi,
I'm sorry, but I have too little time to comment more extensively on this
subject (other duties demand attention). Below you'll find an algorithm,
that chooses a proper value of n from where to start the log2 algorithm
presented earlier. It does not depend on limits and it should always
Gennaro Prota:
Vesa Karvonen:
enum {c = (1 n) = x};
The above should preferably read:
enum {c = (1ul n) = c};
Wrong. The left-shift may give undefined behavior, because n can be
greater than or equal to the number of value bits in an unsigned long
[...]
The problem is that the C
Gennaro Prota:
[...] in many cases boost has implementations enormously more
complicated than necessary.
I would recommend that you seriously show how to make simpler
implementations. I'm sure that significant simplifications, that work as
well as the more complicated implementation, would be
Can someone who was subscribed when the Integer library was approved
explain me what were the reasons to choose the current implementation
of static_log2 against e.g.
template unsigned long n
struct log2 {
BOOST_STATIC_CONSTANT(unsigned long,
value = 1 +
Gennaro Prota:
Can someone who was subscribed when the Integer library was approved
explain me what were the reasons to choose the current implementation
of static_log2 against e.g.
I can't help in that, but
template unsigned long n
struct log2 {
BOOST_STATIC_CONSTANT(unsigned long,