c++ - What is the fastest way to convert very large binary number representation to decimal representation? -


i've got big number stored in binary representation , need output in decimal representation:

struct biginteger {     int *parts; // 1 part stores 12 bits of number, range: 0 0xfff     int parts_n; };  void converttodecstring( biginteger *in, std::string &out ); 

i can't find approach, in linear time.

for demostration can chose order parts. i've got ordered in way, [0] lowest value, , [n-1] highest value.

i afraid cannot done in linear time, because every read bit affects digits of decimal representation. longer digit, longer every new read bit takes.


Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -