Bitcoin Forum
February 21, 2017, 02:54:29 AM *
News: Latest stable version of Bitcoin Core: 0.13.2  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Question on CBigNum::SetCompact  (Read 1255 times)
Forp
Full Member
***
Offline Offline

Activity: 198


View Profile
June 14, 2011, 11:14:22 PM
 #1

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.
1487645669
Hero Member
*
Offline Offline

Posts: 1487645669

View Profile Personal Message (Offline)

Ignore
1487645669
Reply with quote  #2

1487645669
Report to moderator
1487645669
Hero Member
*
Offline Offline

Posts: 1487645669

View Profile Personal Message (Offline)

Ignore
1487645669
Reply with quote  #2

1487645669
Report to moderator
1487645669
Hero Member
*
Offline Offline

Posts: 1487645669

View Profile Personal Message (Offline)

Ignore
1487645669
Reply with quote  #2

1487645669
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1487645669
Hero Member
*
Offline Offline

Posts: 1487645669

View Profile Personal Message (Offline)

Ignore
1487645669
Reply with quote  #2

1487645669
Report to moderator
1487645669
Hero Member
*
Offline Offline

Posts: 1487645669

View Profile Personal Message (Offline)

Ignore
1487645669
Reply with quote  #2

1487645669
Report to moderator
ByteCoin
Sr. Member
****
expert
Offline Offline

Activity: 416


View Profile
June 14, 2011, 11:54:37 PM
 #2

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
Forp
Full Member
***
Offline Offline

Activity: 198


View Profile
June 15, 2011, 03:45:01 PM
 #3

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).
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!