CPython / Decimal and bit length of value.

Nacnud Nac nacnud_uk27 at yahoo.com
Fri Sep 3 16:09:40 EDT 2021


Hi,
Is there a quick way to get the number of bits required to store the value in a Decimal class? 
What obvious thing am I missing? I'm working with really large integers, say, in the order of 5_000_000 of ASCII base 10 digits. 
It seems the function mpd_sizeinbase would be a nice thing to be able to call.....
It'd be nice to just be able to tell the "size of data", or something like that, that was stored in the *data? I note there is len "field" in the structure mpd_t
Sorry for the dumb question....
Thanks,Duncan



More information about the Python-list mailing list