TBigInt

N-bit integer.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/BigInt.h

Include

#include "Math/BigInt.h"

Syntax

template<int32 NumBits, bool bSigned>
class TBigInt

Remarks

N-bit integer.

Constructors

Name Description

Public function

TBigInt()

Default constructor. Initializes the number to zero.

Public function

TBigInt

(
    int64 Other
)

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

Public function

TBigInt

(
    const uint32* InBits
)

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

Public function

TBigInt

(
    const FString& Value
)

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

Public function

TBigInt

(
    const uint8* InData,
    uint32 InNumBytes
)

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

Functions

Name Description

Public function

void

 

Add

(
    const BigInt& Other
)

Adds two integers.

Public function

void

 

BitwiseAnd

(
    const BigInt& Other
)

Bitwise 'and'

Public function

void

 

BitwiseNot()

Bitwise 'not'

Public function

void

 

BitwiseOr

(
    const BigInt& Other
)

Bitwise 'or'

Public function

void

 

Divide

(
    const BigInt& Divisor
)

Divides two integers.

Public function

void

 

DivideWithRemainder

(
    const BigInt& Divisor,
    BigInt& Remainder
)

Divides two integers with remainder.

Public function Const

int32

 

GetBit

(
    int32 BitIndex
)

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

Public function Const

const uint32...

 

GetBits()

Public function

uint32 *

 

GetBits()

Public function Const

int32

 

GetHighestNonZeroBit()

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

Public function Const

int32

 

GetHighestNonZeroWord()

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

Public function Const

bool

 

IsEqual

(
    const BigInt& Other
)

Checks if two integers are equal.

Public function Const

bool

 

IsFirstBitSet()

Public function Const

bool

 

IsGreater

(
    const BigInt& Other
)

This > Other

Public function Const

bool

 

IsGreaterOrEqual

(
    const BigInt& Other
)

This >= Other

Public function Const

bool

 

IsGreaterThanZero()

This > 0

Public function Const

bool

 

IsLess

(
    const BigInt& Other
)

This < Other

Public function Const

bool

 

IsLessOrEqual

(
    const BigInt& Other
)

This <= Other

Public function Const

bool

 

IsLessThanZero()

This < 0

Public function Const

bool

 

IsNegative()

Checks if this integer is negative.

Public function Const

bool

 

IsZero()

This == 0

Public function

void

 

Modulo

(
    const BigInt& Modulus
)

Performs modulo operation on this integer.

Public function

void

 

Multiply

(
    const BigInt& Factor
)

Multiplies two integers.

Public function

void

 

MultiplyFast

(
    const BigInt& Factor
)

Multiplies two positive integers.

Public function

void

 

Negate()

Negates this integer. value = -value

Public function

void

 

Parse

(
    const FString& Value
)

Parses a string representing a hex value

Public function

void

 

Set

(
    int64 Value
)

Initializes this big int with a 64 bit integer value.

Public function

void

 

SetBit

(
    int32 BitIndex,
    int32 Value
)

Sets a bit value.

Public function

void

 

ShiftLeft

(
    const int32 BitCount
)

Shift left by the specified amount of bits.

Public function

void

 

ShiftLeftByOneInternal()

Shift left by 1 bit.

Public function

void

 

ShiftLeftInternal

(
    const int32 BitCount
)

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

Public function

void

 

ShiftRight

(
    const int32 BitCount
)

Shift right by the specified amount of bits.

Public function

void

 

ShiftRightByOneInternal()

Shift right by 1 bit.

Public function

void

 

ShiftRightInternal

(
    const int32 BitCount
)

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

Public function Const

int32

 

Sign()

Returns the sign of this integer.

Public function

void

 

Sqrt()

Calculates square root of this integer.

Public function

void

 

Subtract

(
    const BigInt& Other
)

Subtracts two integers.

Public function Const

int64

 

ToInt()

Returns the value of this big int as a 64-bit integer.

Public function Const

FString

 

ToString()

Returns this big int as a string.

Public function

void

 

Zero()

Sets this integer to 0.

Operators

Name Description

Public function Const

BigInt

 

operator-

(
    const BigInt& Other
)

Public function

BigInt &

 

operator--()

Public function Const

bool

 

operator!=

(
    const BigInt& Other
)

Public function Const

BigInt

 

operator%

(
    const BigInt& Modulus
)

Public function

BigInt &

 

operator%=

(
    const BigInt& Modulus
)

Public function Const

BigInt

 

operator&

(
    const BigInt& Other
)

Public function

BigInt &

 

operator&=

(
    const BigInt& Other
)

Public function Const

BigInt

 

operator*

(
    const BigInt& Other
)

Public function

BigInt &

 

operator*=

(
    const BigInt& Other
)

Public function Const

BigInt

 

operator/

(
    const BigInt& Divider
)

Public function

BigInt &

 

operator/=

(
    const BigInt& Divider
)

Public function Const

bool

 

operator[]

(
    int32 BitIndex
)

Bit indexing operator

Public function Const

BigInt

 

operator|

(
    const BigInt& Other
)

Public function

BigInt &

 

operator|=

(
    const BigInt& Other
)

Public function Const

BigInt

 

operator~()

Public function Const

BigInt

 

operator+

(
    const BigInt& Other
)

Public function

BigInt &

 

operator++()

Public function

BigInt &

 

operator+=

(
    const BigInt& Other
)

Public function Const

bool

 

operator<

(
    const BigInt& Other
)

Public function Const

BigInt

 

operator<<

(
    int32 Count
)

Public function

BigInt &

 

operator<<=

(
    int32 Count
)

Public function Const

bool

 

operator<=

(
    const BigInt& Other
)

Public function

TBigInt &

 

operator=

(
    int64 Other
)

Assignment operator for int64 values.

Public function

BigInt &

 

operator-=

(
    const BigInt& Other
)

Public function Const

bool

 

operator==

(
    const BigInt& Other
)

Public function Const

bool

 

operator>

(
    const BigInt& Other
)

Public function Const

bool

 

operator>=

(
    const BigInt& Other
)

Public function Const

BigInt

 

operator>>

(
    int32 Count
)

Begin operator overloads.

Public function

BigInt &

 

operator>>=

(
    int32 Count
)

Typedefs

Name

Description

BigInt

Constants

Name

Description

BitsPerWord

Word size.

NumWords

One

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss