Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Forp on June 14, 2011, 11:14:22 PM



Title: Question on CBigNum::SetCompact
Post by: Forp on June 14, 2011, 11:14:22 PM
Hi there,

I am having a hard time understanding the CBigNum::SetCompact and GetCompact functions.

Ok, this is about some compact representation and I can see it in the code how it is done. But I am lacking theintuition behind this.

Why is such a representation necessary at all?

And why in exactly *this* manner?

Would be happy for some hint here.


Title: Re: Question on CBigNum::SetCompact
Post by: ByteCoin on June 14, 2011, 11:54:37 PM
I think it's fair to say that this decision was fairly arbitrary. Possibly Satoshi meant to revisit the design to eliminate other areas where more space is wasted but was already getting fed up with the project and chose to release it before he ran out of steam.

ByteCoin


Title: Re: Question on CBigNum::SetCompact
Post by: Forp on June 15, 2011, 03:45:01 PM
to eliminate other areas where more space is wasted

Ah, ok. very helpful !

So it is essentially a more compact form of storing large values for saving space (and probably my attempts to bite the bullet and understand the peculiar details of it are a bit futile).