-
Notifications
You must be signed in to change notification settings - Fork 115
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
msb return type #362
Comments
Sorry to take so long to reply to this: it's by accident, I didn't expect numbers that large! I guess we can only deal with numbers which occupy 1/8th of the available address space, the unsigned int should be a size_t at the very least, and maybe a uintmax_t. |
I guess I mostly care about making it more than 32 bits on 64-bit CPUs, the 1/8th limitation doesn't bother me that much. |
OK the referenced PR is working well, and computations and bit fiddling on cpp_int involving slightly more than 2^32 bits are just about possible if you don't mind the wait. However, what on earth do we do about Thoughts? @mglisse @ckormanyos |
Sorry for causing such a huge patch.
Yes, the standard traits were not really designed for bignum, and any code that may use bignums should use numeric_limits very carefully... |
This is indeed a tough one. My subjective determination is that there is no resolution for this issue yet. The standard would have to eventually cover big integral types which would, as a prerequisite, require some modification or variation of numeric limits.
Whatever we do, it's going to end up wrong, in the sense that it is non-standardized. My question would be what is the least wrong? My opinion is based almost solely on types having fixed widths like a million or a billion digits. In those cases I have found the latter suggestion the least wrong of the suggestions --- i.e., changing the type(s) of the How bad is it to keep it at |
That's what I went for, seems to work OK so far... |
Hello,
I notice that functions like
msb
that return a number of bits (not bytes or limbs) are documented to returnunsigned int
always. This means that a number that takes 600MB of memory is already too large for this function on most platforms. Is this limitation documented somewhere, and is it on purpose?The text was updated successfully, but these errors were encountered: