Rosetta
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
detail::bigint Class Reference

#include <format-inl.h>

Public Member Functions

 bigint ()
 
 bigint (uint64_t n)
 
 ~bigint ()
 
 bigint (const bigint &)=delete
 
void operator= (const bigint &)=delete
 
void assign (const bigint &other)
 
void assign (uint64_t n)
 
int num_bigits () const
 
FMT_NOINLINE bigintoperator<<= (int shift)
 
template<typename Int >
bigintoperator*= (Int value)
 
void assign_pow10 (int exp)
 
void square ()
 
void align (const bigint &other)
 
int divmod_assign (const bigint &divisor)
 

Private Types

enum  { bigits_capacity = 32 }
 
using bigit = uint32_t
 
using double_bigit = uint64_t
 

Private Member Functions

bigit operator[] (int index) const
 
bigitoperator[] (int index)
 
void subtract_bigits (int index, bigit other, bigit &borrow)
 
void remove_leading_zeros ()
 
void subtract_aligned (const bigint &other)
 
void multiply (uint32_t value)
 
void multiply (uint64_t value)
 

Private Attributes

basic_memory_buffer< bigit, bigits_capacitybigits_
 
int exp_
 

Static Private Attributes

static FMT_CONSTEXPR_DECL const int bigit_bits = bits<bigit>::value
 

Friends

struct formatter< bigint >
 
int compare (const bigint &lhs, const bigint &rhs)
 
int add_compare (const bigint &lhs1, const bigint &lhs2, const bigint &rhs)
 

Member Typedef Documentation

◆ bigit

◆ double_bigit

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
bigits_capacity 

Constructor & Destructor Documentation

◆ bigint() [1/3]

detail::bigint::bigint ( )
inline

◆ bigint() [2/3]

detail::bigint::bigint ( uint64_t  n)
inlineexplicit

◆ ~bigint()

detail::bigint::~bigint ( )
inline

◆ bigint() [3/3]

detail::bigint::bigint ( const bigint )
delete

Member Function Documentation

◆ align()

void detail::bigint::align ( const bigint other)
inline

◆ assign() [1/2]

void detail::bigint::assign ( const bigint other)
inline

◆ assign() [2/2]

void detail::bigint::assign ( uint64_t  n)
inline

◆ assign_pow10()

void detail::bigint::assign_pow10 ( int  exp)
inline

References assign(), detail::exp, and square().

Referenced by detail::fallback_format().

◆ divmod_assign()

int detail::bigint::divmod_assign ( const bigint divisor)
inline

◆ multiply() [1/2]

void detail::bigint::multiply ( uint32_t  value)
inlineprivate

◆ multiply() [2/2]

void detail::bigint::multiply ( uint64_t  value)
inlineprivate

◆ num_bigits()

int detail::bigint::num_bigits ( ) const
inline

◆ operator*=()

template<typename Int >
bigint& detail::bigint::operator*= ( Int  value)
inline

References FMT_ASSERT, and multiply().

◆ operator<<=()

FMT_NOINLINE bigint& detail::bigint::operator<<= ( int  shift)
inline

◆ operator=()

void detail::bigint::operator= ( const bigint )
delete

◆ operator[]() [1/2]

bigit& detail::bigint::operator[] ( int  index)
inlineprivate

References bigits_, and detail::to_unsigned().

◆ operator[]() [2/2]

bigit detail::bigint::operator[] ( int  index) const
inlineprivate

References bigits_, and detail::to_unsigned().

◆ remove_leading_zeros()

void detail::bigint::remove_leading_zeros ( )
inlineprivate

◆ square()

void detail::bigint::square ( )
inline

◆ subtract_aligned()

void detail::bigint::subtract_aligned ( const bigint other)
inlineprivate

◆ subtract_bigits()

void detail::bigint::subtract_bigits ( int  index,
bigit  other,
bigit borrow 
)
inlineprivate

References bigit_bits, and ObjexxFCL::index().

Referenced by subtract_aligned().

Friends And Related Function Documentation

◆ add_compare

int add_compare ( const bigint lhs1,
const bigint lhs2,
const bigint rhs 
)
friend

◆ compare

int compare ( const bigint lhs,
const bigint rhs 
)
friend

Referenced by divmod_assign(), and subtract_aligned().

◆ formatter< bigint >

friend struct formatter< bigint >
friend

Member Data Documentation

◆ bigit_bits

FMT_CONSTEXPR_DECL const int detail::bigint::bigit_bits = bits<bigit>::value
staticprivate

◆ bigits_

basic_memory_buffer<bigit, bigits_capacity> detail::bigint::bigits_
private

◆ exp_

int detail::bigint::exp_
private

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