Photon 1.0.0
Loading...
Searching...
No Matches
bigint Class Reference

#include <format.h>

Public Member Functions

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

Private Types

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

Private Member Functions

FMT_CONSTEXPR20 bigit operator[] (int index) const
 
FMT_CONSTEXPR20 bigitoperator[] (int index)
 
FMT_CONSTEXPR20 void subtract_bigits (int index, bigit other, bigit &borrow)
 
FMT_CONSTEXPR20 void remove_leading_zeros ()
 
FMT_CONSTEXPR20 void subtract_aligned (const bigint &other)
 
FMT_CONSTEXPR20 void multiply (uint32_t value)
 
template<typename UInt , FMT_ENABLE_IF(std::is_same< UInt, uint64_t >::value||std::is_same< UInt, uint128_t >::value) >
FMT_CONSTEXPR20 void multiply (UInt value)
 
template<typename UInt , FMT_ENABLE_IF(std::is_same< UInt, uint64_t >::value||std::is_same< UInt, uint128_t >::value) >
FMT_CONSTEXPR20 void assign (UInt n)
 

Private Attributes

basic_memory_buffer< bigit, bigits_capacitybigits_
 
int exp_
 

Static Private Attributes

static constexpr const int bigit_bits = num_bits<bigit>()
 

Friends

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

Member Typedef Documentation

◆ bigit

using bigint::bigit = uint32_t
private

◆ double_bigit

using bigint::double_bigit = uint64_t
private

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
bigits_capacity 

Constructor & Destructor Documentation

◆ bigint() [1/3]

FMT_CONSTEXPR20 bigint::bigint ( )
inline

◆ bigint() [2/3]

bigint::bigint ( uint64_t  n)
inlineexplicit

◆ bigint() [3/3]

bigint::bigint ( const bigint )
delete

Member Function Documentation

◆ align()

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

◆ assign() [1/2]

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

◆ assign() [2/2]

template<typename UInt , FMT_ENABLE_IF(std::is_same< UInt, uint64_t >::value||std::is_same< UInt, uint128_t >::value) >
FMT_CONSTEXPR20 void bigint::assign ( UInt  n)
inlineprivate

◆ assign_pow10()

FMT_CONSTEXPR20 void bigint::assign_pow10 ( int  exp)
inline

◆ divmod_assign()

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

◆ multiply() [1/2]

template<typename UInt , FMT_ENABLE_IF(std::is_same< UInt, uint64_t >::value||std::is_same< UInt, uint128_t >::value) >
FMT_CONSTEXPR20 void bigint::multiply ( UInt  value)
inlineprivate

◆ multiply() [2/2]

FMT_CONSTEXPR20 void bigint::multiply ( uint32_t  value)
inlineprivate

◆ num_bigits()

FMT_CONSTEXPR20 int bigint::num_bigits ( ) const
inline

◆ operator*=()

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

◆ operator<<=()

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

◆ operator=() [1/2]

void bigint::operator= ( const bigint )
delete

◆ operator=() [2/2]

template<typename Int >
FMT_CONSTEXPR20 void bigint::operator= ( Int  n)
inline

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ remove_leading_zeros()

FMT_CONSTEXPR20 void bigint::remove_leading_zeros ( )
inlineprivate

◆ square()

FMT_CONSTEXPR20 void bigint::square ( )
inline

◆ subtract_aligned()

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

◆ subtract_bigits()

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

Friends And Related Symbol Documentation

◆ add_compare

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

◆ compare

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

◆ formatter< bigint >

friend struct formatter< bigint >
friend

Member Data Documentation

◆ bigit_bits

constexpr const int bigint::bigit_bits = num_bits<bigit>()
staticconstexprprivate

◆ bigits_

basic_memory_buffer<bigit, bigits_capacity> bigint::bigits_
private

◆ exp_

int bigint::exp_
private

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