nfx-datatypes 0.1.1
Cross-platform C++ library with high-precision Int128 and Decimal datatypes
Loading...
Searching...
No Matches
nfx::datatypes::Int128 Class Referencefinal

Cross-platform 128-bit signed integer type. More...

#include <nfx/datatypes/Int128.h>

Public Member Functions

constexpr Int128 () noexcept
 Default constructor.
constexpr Int128 (int val) noexcept
 Construct from signed 32-bit integer.
constexpr Int128 (std::int64_t val) noexcept
 Construct from signed 64-bit integer.
constexpr Int128 (std::uint32_t val) noexcept
 Construct from unsigned 32-bit integer.
constexpr Int128 (std::uint64_t val) noexcept
 Construct from unsigned 64-bit integer.
constexpr Int128 (std::uint64_t low, std::uint64_t high) noexcept
 Construct from two 64-bit words.
 Int128 (std::string_view str)
 Construct from string (exact parsing).
 Int128 (float val)
 Construct from single-precision floating-point value.
 Int128 (double val)
 Construct from double-precision floating-point value.
 Int128 (const Decimal &decimal)
 Construct from Decimal value.
constexpr Int128 (const Int128 &other) noexcept=default
 Copy constructor.
constexpr Int128 (Int128 &&other) noexcept=default
 Move constructor.
 ~Int128 ()=default
 Destructor.
constexpr Int128operator= (const Int128 &other) noexcept=default
 Copy assignment operator.
constexpr Int128operator= (Int128 &&other) noexcept=default
 Move assignment operator.
std::strong_ordering operator<=> (const Int128 &other) const noexcept
 Three-way comparison operator (C++20).
bool operator== (const Int128 &other) const noexcept
 Equality operator.
bool operator== (int val) const noexcept
 Equality comparison with signed 32-bit integer.
bool operator!= (int val) const noexcept
 Inequality comparison with signed 32-bit integer.
bool operator< (int val) const noexcept
 Less than comparison with signed 32-bit integer.
bool operator<= (int val) const noexcept
 Less than or equal comparison with signed 32-bit integer.
bool operator> (int val) const noexcept
 Greater than comparison with signed 32-bit integer.
bool operator>= (int val) const noexcept
 Greater than or equal comparison with signed 32-bit integer.
bool operator== (std::int64_t val) const noexcept
 Equality comparison with signed 64-bit integer.
bool operator!= (std::int64_t val) const noexcept
 Inequality comparison with signed 64-bit integer.
bool operator< (std::int64_t val) const noexcept
 Less than comparison with signed 64-bit integer.
bool operator<= (std::int64_t val) const noexcept
 Less than or equal comparison with signed 64-bit integer.
bool operator> (std::int64_t val) const noexcept
 Greater than comparison with signed 64-bit integer.
bool operator>= (std::int64_t val) const noexcept
 Greater than or equal comparison with signed 64-bit integer.
bool operator== (std::uint64_t val) const noexcept
 Equality comparison with unsigned 64-bit integer.
bool operator!= (std::uint64_t val) const noexcept
 Inequality comparison with unsigned 64-bit integer.
bool operator< (std::uint64_t val) const noexcept
 Less than comparison with unsigned 64-bit integer.
bool operator<= (std::uint64_t val) const noexcept
 Less than or equal comparison with unsigned 64-bit integer.
bool operator> (std::uint64_t val) const noexcept
 Greater than comparison with unsigned 64-bit integer.
bool operator>= (std::uint64_t val) const noexcept
 Greater than or equal comparison with unsigned 64-bit integer.
bool operator== (float val) const noexcept
 Equality comparison with single-precision floating-point.
bool operator!= (float val) const noexcept
 Inequality comparison with single-precision floating-point.
bool operator< (float val) const noexcept
 Less than comparison with single-precision floating-point.
bool operator<= (float val) const noexcept
 Less than or equal comparison with single-precision floating-point.
bool operator> (float val) const noexcept
 Greater than comparison with single-precision floating-point.
bool operator>= (float val) const noexcept
 Greater than or equal comparison with single-precision floating-point.
bool operator== (double val) const noexcept
 Equality comparison with double-precision floating-point.
bool operator!= (double val) const noexcept
 Inequality comparison with double-precision floating-point.
bool operator< (double val) const noexcept
 Less than comparison with double-precision floating-point.
bool operator<= (double val) const noexcept
 Less than or equal comparison with double-precision floating-point.
bool operator> (double val) const noexcept
 Greater than comparison with double-precision floating-point.
bool operator>= (double val) const noexcept
 Greater than or equal comparison with double-precision floating-point.
bool operator== (const Decimal &val) const noexcept
 Equality comparison with Decimal.
bool operator!= (const Decimal &val) const noexcept
 Inequality comparison with Decimal.
bool operator< (const Decimal &val) const noexcept
 Less than comparison with Decimal.
bool operator<= (const Decimal &val) const noexcept
 Less than or equal comparison with Decimal.
bool operator> (const Decimal &val) const noexcept
 Greater than comparison with Decimal.
bool operator>= (const Decimal &val) const noexcept
 Greater than or equal comparison with Decimal.
Int128 operator+ (const Int128 &other) const noexcept
 Addition operator.
Int128 operator- (const Int128 &other) const noexcept
 Subtraction operator.
Int128 operator* (const Int128 &other) const noexcept
 Multiplication operator.
Int128 operator/ (const Int128 &other) const
 Division operator.
Int128operator+= (const Int128 &other) noexcept
 Addition assignment operator.
Int128operator-= (const Int128 &other) noexcept
 Subtraction assignment operator.
Int128operator*= (const Int128 &other) noexcept
 Multiplication assignment operator.
Int128operator/= (const Int128 &other)
 Division assignment operator.
Int128operator%= (const Int128 &other)
 Modulo assignment operator.
Int128 operator% (const Int128 &other) const
 Modulo operator.
Int128 operator- () const noexcept
 Unary minus operator.
std::uint64_t toLow () const noexcept
 Get lower 64 bits.
std::uint64_t toHigh () const noexcept
 Get upper 64 bits.
Int128 abs () const noexcept
 Get absolute value.
Int128 isqrt () const
 Calculate integer square root (floor of exact square root).
std::string toString () const
 Convert to string with exact precision.
std::array< std::int32_t, 4 > toBits () const noexcept
 Get internal 32-bit representation.

Static Public Member Functions

static bool fromString (std::string_view str, Int128 &result) noexcept
 Try to parse 128-bit integer from string without throwing.
static std::optional< Int128fromString (std::string_view str) noexcept
 Parse 128-bit integer from string with optional return.

Detailed Description

Cross-platform 128-bit signed integer type.

Implements portable 128-bit signed integer arithmetic with:

  • Native __int128 support on GCC/Clang for maximum performance
  • Manual implementation on MSVC using two 64-bit words
  • Full arithmetic and comparison operator support
  • Optimized for decimal arithmetic operations
  • Cross-platform value consistency and API compatibility

Definition at line 145 of file Int128.h.

Constructor & Destructor Documentation

◆ Int128() [1/11]

nfx::datatypes::Int128::Int128 ( int val)
inlineexplicitconstexprnoexcept

Construct from signed 32-bit integer.

Parameters
val32-bit signed value
Here is the call graph for this function:

◆ Int128() [2/11]

nfx::datatypes::Int128::Int128 ( std::int64_t val)
inlineexplicitconstexprnoexcept

Construct from signed 64-bit integer.

Parameters
val64-bit signed value
Here is the call graph for this function:

◆ Int128() [3/11]

nfx::datatypes::Int128::Int128 ( std::uint32_t val)
inlineexplicitconstexprnoexcept

Construct from unsigned 32-bit integer.

Parameters
val32-bit unsigned value
Here is the call graph for this function:

◆ Int128() [4/11]

nfx::datatypes::Int128::Int128 ( std::uint64_t val)
inlineexplicitconstexprnoexcept

Construct from unsigned 64-bit integer.

Parameters
val64-bit unsigned value
Here is the call graph for this function:

◆ Int128() [5/11]

nfx::datatypes::Int128::Int128 ( std::uint64_t low,
std::uint64_t high )
constexprnoexcept

Construct from two 64-bit words.

Parameters
lowLower 64 bits
highUpper 64 bits
Here is the call graph for this function:

◆ Int128() [6/11]

nfx::datatypes::Int128::Int128 ( std::string_view str)
inlineexplicit

Construct from string (exact parsing).

Parameters
strString representation (e.g., "123", "-456789")
Exceptions
std::invalid_argumentif string is not a valid integer

◆ Int128() [7/11]

nfx::datatypes::Int128::Int128 ( float val)
explicit

Construct from single-precision floating-point value.

Parameters
valFloat value to convert

Follows C++ standard truncation behavior (like static_cast<int>(float)):

  • Fractional parts are truncated toward zero (42.9f → 42, -42.9f → -42)
  • NaN and infinity values are converted to zero
  • Values exceeding Int128 range are clamped to Int128 limits (±2^127)
    Note
    This matches the behavior of static_cast<int>(float) for consistency

◆ Int128() [8/11]

nfx::datatypes::Int128::Int128 ( double val)
explicit

Construct from double-precision floating-point value.

Parameters
valDouble value to convert

Follows C++ standard truncation behavior (like static_cast<int>(double)):

  • Fractional parts are truncated toward zero (42.7 → 42, -42.7 → -42)
  • NaN and infinity values are converted to zero
  • Values exceeding Int128 range are clamped to Int128 limits (±2^127)
  • Uses string conversion to preserve full double precision (53-bit mantissa)
    Note
    This matches the behavior of static_cast<int>(double) for consistency

◆ Int128() [9/11]

nfx::datatypes::Int128::Int128 ( const Decimal & decimal)
explicit

Construct from Decimal value.

Parameters
decimalDecimal value to convert

Follows C++ standard truncation behavior (like static_cast<int>(double)):

  • Fractional parts are truncated toward zero (42.7 → 42, -42.7 → -42)
  • Integer part is extracted by dividing mantissa by 10^scale
  • Zero values are handled efficiently
  • Large values within Int128 range are supported
    Note
    This matches the behavior of static_cast<int>(double) for consistency, rather than throwing exceptions for fractional parts

◆ Int128() [10/11]

nfx::datatypes::Int128::Int128 ( const Int128 & other)
constexprdefaultnoexcept

Copy constructor.

Parameters
otherThe Int128 object to copy from
Here is the call graph for this function:

◆ Int128() [11/11]

nfx::datatypes::Int128::Int128 ( Int128 && other)
constexprdefaultnoexcept

Move constructor.

Parameters
otherThe Int128 object to move from
Here is the call graph for this function:

Member Function Documentation

◆ abs()

Int128 nfx::datatypes::Int128::abs ( ) const
inlinenodiscardnoexcept

Get absolute value.

Returns
Absolute value of the integer
Note
This function is marked [[nodiscard]] - the return value should not be ignored
Here is the call graph for this function:

◆ fromString() [1/2]

std::optional< Int128 > nfx::datatypes::Int128::fromString ( std::string_view str)
staticnodiscardnoexcept

Parse 128-bit integer from string with optional return.

Parameters
strString representation of integer (e.g., "12345", "-9876543210")
Returns
std::optional<Int128> containing parsed value if successful, std::nullopt if parsing failed

This is a convenience wrapper around the two-parameter fromString method. Supports the same input formats:

  • Positive integers: "123", "9876543210"
  • Negative integers: "-123", "-9876543210"
  • Very large integers: "170141183460469231731687303715884105727"
  • Leading/trailing whitespace is not supported (will cause parsing failure)
  • Scientific notation is not supported
  • Only decimal base is supported (no hex, octal, or binary)
    Note
    This function is marked [[nodiscard]] - the return value should not be ignored
    For error details, use the two-parameter overload with explicit error handling
    Range: -2^127 to 2^127-1 (±170,141,183,460,469,231,731,687,303,715,884,105,72x)
Here is the call graph for this function:

◆ fromString() [2/2]

bool nfx::datatypes::Int128::fromString ( std::string_view str,
Int128 & result )
staticnodiscardnoexcept

Try to parse 128-bit integer from string without throwing.

Parameters
strString representation of integer (e.g., "12345", "-9876543210")
resultOutput parameter to store parsed value on success
Returns
true if parsing succeeded, false if string format is invalid or value is outside Int128 range

Parses string representations of 128-bit signed integers with comprehensive format support. Supported input formats:

  • Positive integers: "123", "9876543210"
  • Negative integers: "-123", "-9876543210"
  • Very large integers: "170141183460469231731687303715884105727"
  • Leading/trailing whitespace is not supported (will cause parsing failure)
  • Scientific notation is not supported
  • Only decimal base is supported (no hex, octal, or binary)
    Note
    This function is marked [[nodiscard]] - the return value should not be ignored
    Range: -2^127 to 2^127-1 (±170,141,183,460,469,231,731,687,303,715,884,105,72x)
    For convenience wrapper with std::optional return, use the single-parameter overload
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isqrt()

Int128 nfx::datatypes::Int128::isqrt ( ) const
nodiscard

Calculate integer square root (floor of exact square root).

Returns
Largest integer i such that i*i <= this
Exceptions
std::domain_errorif this is negative
Note
Returns floor(sqrt(this)) - always rounds down
For exact precision, convert to Decimal and use Decimal::sqrt()
This function is marked [[nodiscard]] - the return value should not be ignored
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=() [1/6]

bool nfx::datatypes::Int128::operator!= ( const Decimal & val) const
inlinenoexcept

Inequality comparison with Decimal.

Parameters
valRight operand
Returns
true if values are not equal

◆ operator!=() [2/6]

bool nfx::datatypes::Int128::operator!= ( double val) const
inlinenoexcept

Inequality comparison with double-precision floating-point.

Parameters
valRight operand
Returns
true if values are not equal

◆ operator!=() [3/6]

bool nfx::datatypes::Int128::operator!= ( float val) const
inlinenoexcept

Inequality comparison with single-precision floating-point.

Parameters
valRight operand
Returns
true if values are not equal

◆ operator!=() [4/6]

bool nfx::datatypes::Int128::operator!= ( int val) const
inlinenoexcept

Inequality comparison with signed 32-bit integer.

Parameters
valRight operand
Returns
true if values are not equal

◆ operator!=() [5/6]

bool nfx::datatypes::Int128::operator!= ( std::int64_t val) const
noexcept

Inequality comparison with signed 64-bit integer.

Parameters
valRight operand
Returns
true if values are not equal

◆ operator!=() [6/6]

bool nfx::datatypes::Int128::operator!= ( std::uint64_t val) const
inlinenoexcept

Inequality comparison with unsigned 64-bit integer.

Parameters
valRight operand
Returns
true if values are not equal

◆ operator%()

Int128 nfx::datatypes::Int128::operator% ( const Int128 & other) const
inline

Modulo operator.

Parameters
otherDivisor
Returns
Remainder of division
Exceptions
std::overflow_errorif divisor is zero
Here is the call graph for this function:

◆ operator%=()

Int128 & nfx::datatypes::Int128::operator%= ( const Int128 & other)
inline

Modulo assignment operator.

Parameters
otherDivisor
Returns
Reference to this after modulo operation
Exceptions
std::overflow_errorif divisor is zero
Here is the call graph for this function:

◆ operator*()

Int128 nfx::datatypes::Int128::operator* ( const Int128 & other) const
noexcept

Multiplication operator.

Parameters
otherRight operand
Returns
Product of this and other
Here is the call graph for this function:

◆ operator*=()

Int128 & nfx::datatypes::Int128::operator*= ( const Int128 & other)
inlinenoexcept

Multiplication assignment operator.

Parameters
otherRight operand to multiply by
Returns
Reference to this after multiplication
Here is the call graph for this function:

◆ operator+()

Int128 nfx::datatypes::Int128::operator+ ( const Int128 & other) const
inlinenoexcept

Addition operator.

Parameters
otherRight operand
Returns
Sum of this and other
Here is the call graph for this function:

◆ operator+=()

Int128 & nfx::datatypes::Int128::operator+= ( const Int128 & other)
inlinenoexcept

Addition assignment operator.

Parameters
otherRight operand to add
Returns
Reference to this after addition
Here is the call graph for this function:

◆ operator-() [1/2]

Int128 nfx::datatypes::Int128::operator- ( ) const
inlinenoexcept

Unary minus operator.

Returns
Negated value
Here is the call graph for this function:

◆ operator-() [2/2]

Int128 nfx::datatypes::Int128::operator- ( const Int128 & other) const
inlinenoexcept

Subtraction operator.

Parameters
otherRight operand
Returns
Difference of this and other
Here is the call graph for this function:

◆ operator-=()

Int128 & nfx::datatypes::Int128::operator-= ( const Int128 & other)
inlinenoexcept

Subtraction assignment operator.

Parameters
otherRight operand to subtract
Returns
Reference to this after subtraction
Here is the call graph for this function:

◆ operator/()

Int128 nfx::datatypes::Int128::operator/ ( const Int128 & other) const

Division operator.

Parameters
otherDivisor
Returns
Result of division
Exceptions
std::overflow_errorif divisor is zero
Here is the call graph for this function:

◆ operator/=()

Int128 & nfx::datatypes::Int128::operator/= ( const Int128 & other)
inline

Division assignment operator.

Parameters
otherDivisor
Returns
Reference to this after division
Exceptions
std::overflow_errorif divisor is zero
Here is the call graph for this function:

◆ operator<() [1/6]

bool nfx::datatypes::Int128::operator< ( const Decimal & val) const
noexcept

Less than comparison with Decimal.

Parameters
valRight operand
Returns
true if this is less than val

◆ operator<() [2/6]

bool nfx::datatypes::Int128::operator< ( double val) const
noexcept

Less than comparison with double-precision floating-point.

Parameters
valRight operand
Returns
true if this is less than val

◆ operator<() [3/6]

bool nfx::datatypes::Int128::operator< ( float val) const
inlinenoexcept

Less than comparison with single-precision floating-point.

Parameters
valRight operand
Returns
true if this is less than val

◆ operator<() [4/6]

bool nfx::datatypes::Int128::operator< ( int val) const
inlinenoexcept

Less than comparison with signed 32-bit integer.

Parameters
valRight operand
Returns
true if this is less than val

◆ operator<() [5/6]

bool nfx::datatypes::Int128::operator< ( std::int64_t val) const
inlinenoexcept

Less than comparison with signed 64-bit integer.

Parameters
valRight operand
Returns
true if this is less than val

◆ operator<() [6/6]

bool nfx::datatypes::Int128::operator< ( std::uint64_t val) const
inlinenoexcept

Less than comparison with unsigned 64-bit integer.

Parameters
valRight operand
Returns
true if this is less than val

◆ operator<=() [1/6]

bool nfx::datatypes::Int128::operator<= ( const Decimal & val) const
inlinenoexcept

Less than or equal comparison with Decimal.

Parameters
valRight operand
Returns
true if this is less than or equal to val

◆ operator<=() [2/6]

bool nfx::datatypes::Int128::operator<= ( double val) const
inlinenoexcept

Less than or equal comparison with double-precision floating-point.

Parameters
valRight operand
Returns
true if this is less than or equal to val

◆ operator<=() [3/6]

bool nfx::datatypes::Int128::operator<= ( float val) const
inlinenoexcept

Less than or equal comparison with single-precision floating-point.

Parameters
valRight operand
Returns
true if this is less than or equal to val

◆ operator<=() [4/6]

bool nfx::datatypes::Int128::operator<= ( int val) const
inlinenoexcept

Less than or equal comparison with signed 32-bit integer.

Parameters
valRight operand
Returns
true if this is less than or equal to val

◆ operator<=() [5/6]

bool nfx::datatypes::Int128::operator<= ( std::int64_t val) const
inlinenoexcept

Less than or equal comparison with signed 64-bit integer.

Parameters
valRight operand
Returns
true if this is less than or equal to val

◆ operator<=() [6/6]

bool nfx::datatypes::Int128::operator<= ( std::uint64_t val) const
inlinenoexcept

Less than or equal comparison with unsigned 64-bit integer.

Parameters
valRight operand
Returns
true if this is less than or equal to val

◆ operator<=>()

std::strong_ordering nfx::datatypes::Int128::operator<=> ( const Int128 & other) const
inlinenoexcept

Three-way comparison operator (C++20).

Parameters
otherRight operand to compare with
Returns
std::strong_ordering indicating relative order (less, equal, or greater)
Note
Compiler auto-generates operator!=, <, <=, >, >= from this operator
Here is the call graph for this function:

◆ operator=() [1/2]

Int128 & nfx::datatypes::Int128::operator= ( const Int128 & other)
constexprdefaultnoexcept

Copy assignment operator.

Parameters
otherThe Int128 object to copy from
Returns
Reference to this Int128 object after assignment
Here is the call graph for this function:

◆ operator=() [2/2]

Int128 & nfx::datatypes::Int128::operator= ( Int128 && other)
constexprdefaultnoexcept

Move assignment operator.

Parameters
otherThe Int128 object to move from
Returns
Reference to this Int128 object after assignment
Here is the call graph for this function:

◆ operator==() [1/7]

bool nfx::datatypes::Int128::operator== ( const Decimal & val) const
noexcept

Equality comparison with Decimal.

Parameters
valRight operand
Returns
true if values are equal
Note
For equality, the Decimal must have no fractional part and represent the same integer value

◆ operator==() [2/7]

bool nfx::datatypes::Int128::operator== ( const Int128 & other) const
inlinenoexcept

Equality operator.

Parameters
otherRight operand
Returns
true if values are equal
Note
Required alongside operator<=> for complete C++20 comparison support
Here is the call graph for this function:

◆ operator==() [3/7]

bool nfx::datatypes::Int128::operator== ( double val) const
noexcept

Equality comparison with double-precision floating-point.

Parameters
valRight operand
Returns
true if values are equal (within floating-point precision)

◆ operator==() [4/7]

bool nfx::datatypes::Int128::operator== ( float val) const
inlinenoexcept

Equality comparison with single-precision floating-point.

Parameters
valRight operand
Returns
true if values are equal (within floating-point precision)

◆ operator==() [5/7]

bool nfx::datatypes::Int128::operator== ( int val) const
inlinenoexcept

Equality comparison with signed 32-bit integer.

Parameters
valRight operand
Returns
true if values are equal

◆ operator==() [6/7]

bool nfx::datatypes::Int128::operator== ( std::int64_t val) const
inlinenoexcept

Equality comparison with signed 64-bit integer.

Parameters
valRight operand
Returns
true if values are equal

◆ operator==() [7/7]

bool nfx::datatypes::Int128::operator== ( std::uint64_t val) const
inlinenoexcept

Equality comparison with unsigned 64-bit integer.

Parameters
valRight operand
Returns
true if values are equal

◆ operator>() [1/6]

bool nfx::datatypes::Int128::operator> ( const Decimal & val) const
inlinenoexcept

Greater than comparison with Decimal.

Parameters
valRight operand
Returns
true if this is greater than val

◆ operator>() [2/6]

bool nfx::datatypes::Int128::operator> ( double val) const
noexcept

Greater than comparison with double-precision floating-point.

Parameters
valRight operand
Returns
true if this is greater than val

◆ operator>() [3/6]

bool nfx::datatypes::Int128::operator> ( float val) const
inlinenoexcept

Greater than comparison with single-precision floating-point.

Parameters
valRight operand
Returns
true if this is greater than val

◆ operator>() [4/6]

bool nfx::datatypes::Int128::operator> ( int val) const
inlinenoexcept

Greater than comparison with signed 32-bit integer.

Parameters
valRight operand
Returns
true if this is greater than val

◆ operator>() [5/6]

bool nfx::datatypes::Int128::operator> ( std::int64_t val) const
inlinenoexcept

Greater than comparison with signed 64-bit integer.

Parameters
valRight operand
Returns
true if this is greater than val

◆ operator>() [6/6]

bool nfx::datatypes::Int128::operator> ( std::uint64_t val) const
inlinenoexcept

Greater than comparison with unsigned 64-bit integer.

Parameters
valRight operand
Returns
true if this is greater than val

◆ operator>=() [1/6]

bool nfx::datatypes::Int128::operator>= ( const Decimal & val) const
inlinenoexcept

Greater than or equal comparison with Decimal.

Parameters
valRight operand
Returns
true if this is greater than or equal to val

◆ operator>=() [2/6]

bool nfx::datatypes::Int128::operator>= ( double val) const
inlinenoexcept

Greater than or equal comparison with double-precision floating-point.

Parameters
valRight operand
Returns
true if this is greater than or equal to val

◆ operator>=() [3/6]

bool nfx::datatypes::Int128::operator>= ( float val) const
inlinenoexcept

Greater than or equal comparison with single-precision floating-point.

Parameters
valRight operand
Returns
true if this is greater than or equal to val

◆ operator>=() [4/6]

bool nfx::datatypes::Int128::operator>= ( int val) const
inlinenoexcept

Greater than or equal comparison with signed 32-bit integer.

Parameters
valRight operand
Returns
true if this is greater than or equal to val

◆ operator>=() [5/6]

bool nfx::datatypes::Int128::operator>= ( std::int64_t val) const
inlinenoexcept

Greater than or equal comparison with signed 64-bit integer.

Parameters
valRight operand
Returns
true if this is greater than or equal to val

◆ operator>=() [6/6]

bool nfx::datatypes::Int128::operator>= ( std::uint64_t val) const
inlinenoexcept

Greater than or equal comparison with unsigned 64-bit integer.

Parameters
valRight operand
Returns
true if this is greater than or equal to val

◆ toBits()

std::array< std::int32_t, 4 > nfx::datatypes::Int128::toBits ( ) const
nodiscardnoexcept

Get internal 32-bit representation.

Returns
Array of 4 32-bit integers representing the 128-bit integer
Note
This function is marked [[nodiscard]] - the return value should not be ignored
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toHigh()

std::uint64_t nfx::datatypes::Int128::toHigh ( ) const
nodiscardnoexcept

Get upper 64 bits.

Returns
Upper 64 bits as unsigned integer
Note
This function is marked [[nodiscard]] - the return value should not be ignored
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toLow()

std::uint64_t nfx::datatypes::Int128::toLow ( ) const
nodiscardnoexcept

Get lower 64 bits.

Returns
Lower 64 bits as unsigned integer
Note
This function is marked [[nodiscard]] - the return value should not be ignored
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

std::string nfx::datatypes::Int128::toString ( ) const
nodiscard

Convert to string with exact precision.

Returns
String representation
Note
This function is marked [[nodiscard]] - the return value should not be ignored
Here is the call graph for this function:
Here is the caller graph for this function:

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