c++ - What is the upper bound of BigInteger with character array implementation? -


if impement biginteger character array (in c++), in terms of power of 10, upper bound in 32bit system?

in other words,

- 10^x < n <= 10^x

(first character reserved sign).

what x in 32 bit system?

please ignore have reserved memory os , consider 4gb memory addressable us.

an 8-bit byte can hold 28, or 256 unique values.

4gb of memory 232, or 4294967296 bytes.

or 4294967295, if subtract 1 byte want reserve sign

that's 34359738360 bits.

this many bits can hold 234359738360 unique values.

- 10^x < n <= 10^x

(first character reserved sign).

what x in 32 bit system?

wolfram alpha suggests - 10^1292913986 < n <= 10^1292913986 largest representable powers of 10.

so x 1,292,913,986.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -