UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TBigInt< NumBits, bSigned > Class Template Reference

#include <BigInt.h>

Public Types

typedef TBigInt< NumBits, bSigned > BigInt
 

Public Member Functions

UE_FORCEINLINE_HINT uint32GetBits ()
 
UE_FORCEINLINE_HINT const uint32GetBits () const
 
UE_FORCEINLINE_HINT void Zero ()
 
void Set (int64 Value)
 
 TBigInt ()
 
 TBigInt (int64 Other)
 
 TBigInt (const uint32 *InBits)
 
 TBigInt (const uint8 *InData, uint32 InNumBytes)
 
 TBigInt (const FString &Value)
 
void ShiftLeftInternal (const int32 BitCount)
 
void ShiftLeftByOneInternal ()
 
void ShiftRightInternal (const int32 BitCount)
 
void ShiftRightByOneInternal ()
 
void Add (const BigInt &Other)
 
void Subtract (const BigInt &Other)
 
bool IsNegative () const
 
int32 Sign () const
 
void Negate ()
 
int32 GetHighestNonZeroWord () const
 
void MultiplyFast (const BigInt &Factor)
 
void Multiply (const BigInt &Factor)
 
void DivideWithRemainder (const BigInt &Divisor, BigInt &Remainder)
 
void Divide (const BigInt &Divisor)
 
void Modulo (const BigInt &Modulus)
 
void Sqrt ()
 
TBigIntoperator= (int64 Other)
 
int32 GetHighestNonZeroBit () const
 
int32 GetBit (int32 BitIndex) const
 
void SetBit (int32 BitIndex, int32 Value)
 
void ShiftLeft (const int32 BitCount)
 
void ShiftRight (const int32 BitCount)
 
void BitwiseOr (const BigInt &Other)
 
void BitwiseAnd (const BigInt &Other)
 
void BitwiseNot ()
 
bool IsEqual (const BigInt &Other) const
 
bool IsLess (const BigInt &Other) const
 
bool IsLessOrEqual (const BigInt &Other) const
 
bool IsGreater (const BigInt &Other) const
 
bool IsGreaterOrEqual (const BigInt &Other) const
 
bool IsZero () const
 
bool IsGreaterThanZero () const
 
bool IsLessThanZero () const
 
bool IsFirstBitSet () const
 
bool operator[] (int32 BitIndex) const
 
BigInt operator>> (int32 Count) const
 
BigIntoperator>>= (int32 Count)
 
BigInt operator<< (int32 Count) const
 
BigIntoperator<<= (int32 Count)
 
BigInt operator+ (const BigInt &Other) const
 
BigIntoperator++ ()
 
BigIntoperator+= (const BigInt &Other)
 
BigInt operator- (const BigInt &Other) const
 
BigIntoperator-- ()
 
BigIntoperator-= (const BigInt &Other)
 
BigInt operator* (const BigInt &Other) const
 
BigIntoperator*= (const BigInt &Other)
 
BigInt operator/ (const BigInt &Divider) const
 
BigIntoperator/= (const BigInt &Divider)
 
BigInt operator% (const BigInt &Modulus) const
 
BigIntoperator%= (const BigInt &Modulus)
 
bool operator< (const BigInt &Other) const
 
bool operator<= (const BigInt &Other) const
 
bool operator> (const BigInt &Other) const
 
bool operator>= (const BigInt &Other) const
 
bool operator== (const BigInt &Other) const
 
bool operator!= (const BigInt &Other) const
 
BigInt operator& (const BigInt &Other) const
 
BigIntoperator&= (const BigInt &Other)
 
BigInt operator| (const BigInt &Other) const
 
BigIntoperator|= (const BigInt &Other)
 
BigInt operator~ () const
 
int64 ToInt () const
 
FString ToString () const
 
void Parse (const FString &Value)
 

Static Public Attributes

static BigInt One
 

Friends

FArchiveoperator<< (FArchive &Ar, BigInt &Value)
 

Detailed Description

template<int32 NumBits, bool bSigned = true>
class TBigInt< NumBits, bSigned >

n-bit integer.

Member Typedef Documentation

◆ BigInt

template<int32 NumBits, bool bSigned = true>
typedef TBigInt<NumBits, bSigned> TBigInt< NumBits, bSigned >::BigInt

Constructor & Destructor Documentation

◆ TBigInt() [1/5]

template<int32 NumBits, bool bSigned = true>
TBigInt< NumBits, bSigned >::TBigInt ( )
inline

Default constructor. Initializes the number to zero.

◆ TBigInt() [2/5]

template<int32 NumBits, bool bSigned = true>
TBigInt< NumBits, bSigned >::TBigInt ( int64  Other)
inline

Constructor. Initializes this big int with a 64 bit integer value.

Parameters
OtherThe value to set.

◆ TBigInt() [3/5]

template<int32 NumBits, bool bSigned = true>
TBigInt< NumBits, bSigned >::TBigInt ( const uint32 InBits)
inlineexplicit

Constructor. Initializes this big int with an array of words.

◆ TBigInt() [4/5]

template<int32 NumBits, bool bSigned = true>
TBigInt< NumBits, bSigned >::TBigInt ( const uint8 InData,
uint32  InNumBytes 
)
inlineexplicit

Constructor. Initializes this big int with an array of bytes.

◆ TBigInt() [5/5]

template<int32 NumBits, bool bSigned = true>
TBigInt< NumBits, bSigned >::TBigInt ( const FString &  Value)
inlineexplicit

Constructor. Initializes this big int with a string representing a hex value.

Member Function Documentation

◆ Add()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::Add ( const BigInt Other)
inline

Adds two integers.

◆ BitwiseAnd()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::BitwiseAnd ( const BigInt Other)
inline

Bitwise 'and'

◆ BitwiseNot()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::BitwiseNot ( )
inline

Bitwise 'not'

◆ BitwiseOr()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::BitwiseOr ( const BigInt Other)
inline

Bitwise 'or'

◆ Divide()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::Divide ( const BigInt Divisor)
inline

Divides two integers.

◆ DivideWithRemainder()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::DivideWithRemainder ( const BigInt Divisor,
BigInt Remainder 
)
inline

Divides two integers with remainder.

◆ GetBit()

template<int32 NumBits, bool bSigned = true>
int32 TBigInt< NumBits, bSigned >::GetBit ( int32  BitIndex) const
inline

Returns a bit value as an integer value (0 or 1).

◆ GetBits() [1/2]

template<int32 NumBits, bool bSigned = true>
UE_FORCEINLINE_HINT uint32 * TBigInt< NumBits, bSigned >::GetBits ( )
inline

◆ GetBits() [2/2]

template<int32 NumBits, bool bSigned = true>
UE_FORCEINLINE_HINT const uint32 * TBigInt< NumBits, bSigned >::GetBits ( ) const
inline

◆ GetHighestNonZeroBit()

template<int32 NumBits, bool bSigned = true>
int32 TBigInt< NumBits, bSigned >::GetHighestNonZeroBit ( ) const
inline

Returns the index of the highest non-zero bit. -1 if no such bit exists.

◆ GetHighestNonZeroWord()

template<int32 NumBits, bool bSigned = true>
int32 TBigInt< NumBits, bSigned >::GetHighestNonZeroWord ( ) const
inline

Returns the index of the highest word that is not zero. -1 if no such word exists.

◆ IsEqual()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsEqual ( const BigInt Other) const
inline

Checks if two integers are equal.

◆ IsFirstBitSet()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsFirstBitSet ( ) const
inline

◆ IsGreater()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsGreater ( const BigInt Other) const
inline

this > Other

◆ IsGreaterOrEqual()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsGreaterOrEqual ( const BigInt Other) const
inline

this >= Other

◆ IsGreaterThanZero()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsGreaterThanZero ( ) const
inline

this > 0

◆ IsLess()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsLess ( const BigInt Other) const
inline

this < Other

◆ IsLessOrEqual()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsLessOrEqual ( const BigInt Other) const
inline

this <= Other

◆ IsLessThanZero()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsLessThanZero ( ) const
inline

this < 0

◆ IsNegative()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsNegative ( ) const
inline

Checks if this integer is negative.

◆ IsZero()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::IsZero ( ) const
inline

this == 0

◆ Modulo()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::Modulo ( const BigInt Modulus)
inline

Performs modulo operation on this integer.

◆ Multiply()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::Multiply ( const BigInt Factor)
inline

Multiplies two integers.

◆ MultiplyFast()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::MultiplyFast ( const BigInt Factor)
inline

Multiplies two positive integers.

◆ Negate()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::Negate ( )
inline

Negates this integer. value = -value

◆ operator!=()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::operator!= ( const BigInt Other) const
inline

◆ operator%()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator% ( const BigInt Modulus) const
inline

◆ operator%=()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator%= ( const BigInt Modulus)
inline

◆ operator&()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator& ( const BigInt Other) const
inline

◆ operator&=()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator&= ( const BigInt Other)
inline

◆ operator*()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator* ( const BigInt Other) const
inline

◆ operator*=()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator*= ( const BigInt Other)
inline

◆ operator+()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator+ ( const BigInt Other) const
inline

◆ operator++()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator++ ( )
inline

◆ operator+=()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator+= ( const BigInt Other)
inline

◆ operator-()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator- ( const BigInt Other) const
inline

◆ operator--()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator-- ( )
inline

◆ operator-=()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator-= ( const BigInt Other)
inline

◆ operator/()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator/ ( const BigInt Divider) const
inline

◆ operator/=()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator/= ( const BigInt Divider)
inline

◆ operator<()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::operator< ( const BigInt Other) const
inline

◆ operator<<()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator<< ( int32  Count) const
inline

◆ operator<<=()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator<<= ( int32  Count)
inline

◆ operator<=()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::operator<= ( const BigInt Other) const
inline

◆ operator=()

template<int32 NumBits, bool bSigned = true>
TBigInt & TBigInt< NumBits, bSigned >::operator= ( int64  Other)
inline

Assignment operator for int64 values.

◆ operator==()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::operator== ( const BigInt Other) const
inline

◆ operator>()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::operator> ( const BigInt Other) const
inline

◆ operator>=()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::operator>= ( const BigInt Other) const
inline

◆ operator>>()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator>> ( int32  Count) const
inline

◆ operator>>=()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator>>= ( int32  Count)
inline

◆ operator[]()

template<int32 NumBits, bool bSigned = true>
bool TBigInt< NumBits, bSigned >::operator[] ( int32  BitIndex) const
inline

Bit indexing operator

◆ operator|()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator| ( const BigInt Other) const
inline

◆ operator|=()

template<int32 NumBits, bool bSigned = true>
BigInt & TBigInt< NumBits, bSigned >::operator|= ( const BigInt Other)
inline

◆ operator~()

template<int32 NumBits, bool bSigned = true>
BigInt TBigInt< NumBits, bSigned >::operator~ ( ) const
inline

◆ Parse()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::Parse ( const FString &  Value)
inline

Parses a string representing a hex value

◆ Set()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::Set ( int64  Value)
inline

Initializes this big int with a 64 bit integer value.

Parameters
ValueThe value to set.

◆ SetBit()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::SetBit ( int32  BitIndex,
int32  Value 
)
inline

Sets a bit value.

◆ ShiftLeft()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::ShiftLeft ( const int32  BitCount)
inline

Shift left by the specified amount of bits.

Parameters
BitCountthe number of bits to shift.

◆ ShiftLeftByOneInternal()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::ShiftLeftByOneInternal ( )
inline

Shift left by 1 bit.

◆ ShiftLeftInternal()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::ShiftLeftInternal ( const int32  BitCount)
inline

Shift left by the specified amount of bits. Does not check if BitCount is valid.

Parameters
BitCountthe number of bits to shift.

◆ ShiftRight()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::ShiftRight ( const int32  BitCount)
inline

Shift right by the specified amount of bits.

Parameters
BitCountthe number of bits to shift.

◆ ShiftRightByOneInternal()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::ShiftRightByOneInternal ( )
inline

Shift right by 1 bit.

◆ ShiftRightInternal()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::ShiftRightInternal ( const int32  BitCount)
inline

Shift right by the specified amount of bits. Does not check if BitCount is valid.

Parameters
BitCountthe number of bits to shift.

◆ Sign()

template<int32 NumBits, bool bSigned = true>
int32 TBigInt< NumBits, bSigned >::Sign ( ) const
inline

Returns the sign of this integer.

◆ Sqrt()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::Sqrt ( )
inline

Calculates square root of this integer.

◆ Subtract()

template<int32 NumBits, bool bSigned = true>
void TBigInt< NumBits, bSigned >::Subtract ( const BigInt Other)
inline

Subtracts two integers.

◆ ToInt()

template<int32 NumBits, bool bSigned = true>
int64 TBigInt< NumBits, bSigned >::ToInt ( ) const
inline

Returns the value of this big int as a 64-bit integer. If the value is greater, the higher bits are truncated.

◆ ToString()

template<int32 NumBits, bool bSigned = true>
FString TBigInt< NumBits, bSigned >::ToString ( ) const
inline

Returns this big int as a string.

◆ Zero()

template<int32 NumBits, bool bSigned = true>
UE_FORCEINLINE_HINT void TBigInt< NumBits, bSigned >::Zero ( )
inline

Sets this integer to 0.

Friends And Related Symbol Documentation

◆ operator<<

template<int32 NumBits, bool bSigned = true>
FArchive & operator<< ( FArchive Ar,
BigInt Value 
)
friend

Serialization.

Member Data Documentation

◆ One

template<int32 NumBits, bool bSigned>
TBigInt< NumBits, bSigned > TBigInt< NumBits, bSigned >::One
static

The documentation for this class was generated from the following file: