256‐bit unsigned big integer.

Synopsis

Declared in <arith_uint256.h>

class arith_uint256
    : public base_uint<256>

Base Classes

Name

Description

base_uint<256>

Template base class for unsigned big integers.

Member Functions

Name

Description

arith_uint256 [constructor]

Constructors

operator=

Assignment operators

CompareTo

Numeric ordering, treating the value as an unsigned integer rather than a byte blob.

EqualTo

Tests whether the value equals a 64‐bit unsigned number.

GetCompact

Encodes the value into the compact difficulty‐target format described above.

GetHex

Hex encoding of the number (with the most significant digits first).

GetLow64

Returns the low 64 bits of the value.

SetCompact

The "compact" format is a representation of a whole number N using an unsigned 32bit number similar to a floating point format. The most significant 8 bits are the unsigned exponent of base 256. This exponent can be thought of as "number of bytes of N". The lower 23 bits are the mantissa. Bit number 24 (0x800000) represents the sign of N. N = (‐1ˆsign) * mantissa * 256ˆ(exponent‐3)

ToString

Returns the value as a human‐readable string.

bits

Returns the position of the highest bit set plus one, or zero if the value is zero.

getdouble

Converts the value to a double‐precision floating‐point number.

operator&=

Applies a bitwise AND with another big integer in place.

operator*=

Multiplication assignment operators

operator++

Increment operators

operator+=

Addition assignment operators

operator‐

Returns the two's‐complement negation of the value.

operator‐‐

Decrement operators

operator‐=

Subtraction assignment operators

operator/=

Divides this value by another big integer in place.

operator<<=

Shifts the value left by the given number of bits in place.

operator>>=

Shifts the value right by the given number of bits in place.

operatorˆ=

Bitwise exclusive‐or assignment operators

operator|=

Bitwise disjunction assignment operators

operator~

Returns the bitwise complement of the value.

size

Returns the size in bytes of the internal representation.

Protected Data Members

Name

Description

pn

Big integer represented with 32‐bit digits, least‐significant first.

Friends

Name

Description

UintToArith256

Converts a uint256 blob to an arithmetic 256‐bit integer.

ArithToUint256

Converts an arithmetic 256‐bit integer to a uint256 blob.

Non-Member Functions

Name

Description

CalculateClaimedHeadersWork

Return the sum of the claimed work on a given set of headers. No verification of PoW is done.

DeriveTarget

Convert nBits value to target.

GetBitsProof

Compute how much work an nBits value corresponds to.

GetBlockProof

Compute how much work a block header corresponds to.

GetBlockProof

Compute how much work a block index entry corresponds to.

operator&

Returns the bitwise AND of two big integers.

operator&

Returns the bitwise AND of two big integers.

operator*

Returns the product of a big integer and a 32‐bit value.

operator*

Returns the product of a big integer and a 32‐bit value.

operator*

Returns the product of two big integers.

operator*

Returns the product of two big integers.

operator+

Returns the sum of two big integers.

operator+

Returns the sum of two big integers.

operator‐

Returns the difference of two big integers.

operator‐

Returns the difference of two big integers.

operator/

Returns the quotient of two big integers.

operator/

Returns the quotient of two big integers.

operator<<

Returns the value shifted left by a number of bits.

operator<<

Returns the value shifted left by a number of bits.

operator<=>

Performs a three‐way comparison of two big integers.

operator<=>

Performs a three‐way comparison of two big integers.

operator==

Tests whether two big integers are equal.

operator==

Tests whether a big integer equals a 64‐bit value.

operator==

Tests whether two big integers are equal.

operator==

Tests whether a big integer equals a 64‐bit value.

operator>>

Returns the value shifted right by a number of bits.

operator>>

Returns the value shifted right by a number of bits.

operatorˆ

Returns the bitwise XOR of two big integers.

operatorˆ

Returns the bitwise XOR of two big integers.

operator|

Returns the bitwise OR of two big integers.

operator|

Returns the bitwise OR of two big integers.

Created with MrDocs