arith_uint256

256-bit unsigned big integer.

Synopsis

Declared in <arith_uint256.h>

class arith_uint256
    : public base_uint<256>

Base Classes

NameDescription
base_uint<256>Template base class for unsigned big integers.

Member Functions

NameDescription
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

NameDescription
pn Big integer represented with 32-bit digits, least-significant first.

Friends

NameDescription
UintToArith256Converts a uint256 blob to an arithmetic 256-bit integer.
ArithToUint256Converts an arithmetic 256-bit integer to a uint256 blob.

Non-Member Functions

NameDescription
CalculateClaimedHeadersWorkReturn the sum of the claimed work on a given set of headers. No verification of PoW is done.
DeriveTargetConvert nBits value to target.
GetBitsProofCompute how much work an nBits value corresponds to.
GetBlockProofCompute how much work a block header corresponds to.
GetBlockProofCompute 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.