Numworks Epsilon  1.4.1
Graphing Calculator Operating System
Poincare::Integer Class Reference

#include <integer.h>

Public Types

typedef uint16_t half_native_uint_t
 
typedef int32_t native_int_t
 
typedef int64_t double_native_int_t
 
typedef uint32_t native_uint_t
 
typedef uint64_t double_native_uint_t
 

Public Member Functions

 Integer (native_int_t i=0)
 
 Integer (double_native_int_t i)
 
 Integer (const char *digits, bool negative=false)
 
 ~Integer ()
 
 Integer (Integer &&other)
 
Integeroperator= (Integer &&other)
 
 Integer (const Integer &other)
 
Integeroperator= (const Integer &other)
 
bool isNegative () const
 
void setNegative (bool negative)
 
int extractedInt () const
 
bool isEqualTo (const Integer &other) const
 
bool isLowerThan (const Integer &other) const
 
int writeTextInBuffer (char *buffer, int bufferSize) const
 
ExpressionLayoutcreateLayout () const
 
template<typename T >
T approximate () const
 
bool isOne () const
 
bool isTwo () const
 
bool isTen () const
 
bool isMinusOne () const
 
bool isZero () const
 

Static Public Member Functions

static Integer exponent (int fractionalPartLength, const char *exponent, int exponentLength, bool exponentNegative)
 
static Integer numerator (const char *integralPart, int integralPartLength, const char *fractionalPart, int fractionalPartLength, bool negative, Integer *exponent)
 
static Integer denominator (Integer *exponent)
 
static int NaturalOrder (const Integer &i, const Integer &j)
 
static Integer Addition (const Integer &i, const Integer &j)
 
static Integer Subtraction (const Integer &i, const Integer &j)
 
static Integer Multiplication (const Integer &i, const Integer &j)
 
static Integer Factorial (const Integer &i)
 
static IntegerDivision Division (const Integer &numerator, const Integer &denominator)
 
static Integer Power (const Integer &i, const Integer &j)
 

Static Public Attributes

static constexpr int k_maxExtractableInteger = 0x7FFFFFFF
 

Detailed Description

Definition at line 15 of file integer.h.

Member Typedef Documentation

◆ double_native_int_t

Definition at line 19 of file integer.h.

◆ double_native_uint_t

Definition at line 21 of file integer.h.

◆ half_native_uint_t

Definition at line 17 of file integer.h.

◆ native_int_t

Definition at line 18 of file integer.h.

◆ native_uint_t

Definition at line 20 of file integer.h.

Constructor & Destructor Documentation

◆ Integer() [1/5]

Poincare::Integer::Integer ( native_int_t  i = 0)
inline

Definition at line 24 of file integer.h.

◆ Integer() [2/5]

Poincare::Integer::Integer ( double_native_int_t  i)

Definition at line 41 of file integer.cpp.

◆ Integer() [3/5]

Poincare::Integer::Integer ( const char *  digits,
bool  negative = false 
)

Definition at line 59 of file integer.cpp.

◆ ~Integer()

Poincare::Integer::~Integer ( )

Definition at line 129 of file integer.cpp.

◆ Integer() [4/5]

Poincare::Integer::Integer ( Integer &&  other)

Definition at line 133 of file integer.cpp.

◆ Integer() [5/5]

Poincare::Integer::Integer ( const Integer other)

Definition at line 149 of file integer.cpp.

Member Function Documentation

◆ Addition()

Integer Poincare::Integer::Addition ( const Integer i,
const Integer j 
)
static

Definition at line 232 of file integer.cpp.

◆ approximate()

template<typename T >
template double Poincare::Integer::approximate< double > ( ) const

Definition at line 479 of file integer.cpp.

◆ createLayout()

ExpressionLayout * Poincare::Integer::createLayout ( ) const

Definition at line 590 of file integer.cpp.

◆ denominator()

Integer Poincare::Integer::denominator ( Integer exponent)
static

Definition at line 117 of file integer.cpp.

◆ Division()

IntegerDivision Poincare::Integer::Division ( const Integer numerator,
const Integer denominator 
)
static

Definition at line 281 of file integer.cpp.

◆ exponent()

Integer Poincare::Integer::exponent ( int  fractionalPartLength,
const char *  exponent,
int  exponentLength,
bool  exponentNegative 
)
static

Definition at line 86 of file integer.cpp.

◆ extractedInt()

int Poincare::Integer::extractedInt ( ) const
inline

Definition at line 45 of file integer.h.

◆ Factorial()

Integer Poincare::Integer::Factorial ( const Integer i)
static

Definition at line 271 of file integer.cpp.

◆ isEqualTo()

bool Poincare::Integer::isEqualTo ( const Integer other) const

Definition at line 222 of file integer.cpp.

◆ isLowerThan()

bool Poincare::Integer::isLowerThan ( const Integer other) const

Definition at line 226 of file integer.cpp.

◆ isMinusOne()

bool Poincare::Integer::isMinusOne ( ) const
inline

Definition at line 71 of file integer.h.

◆ isNegative()

bool Poincare::Integer::isNegative ( ) const
inline

Definition at line 43 of file integer.h.

◆ isOne()

bool Poincare::Integer::isOne ( ) const
inline

Definition at line 68 of file integer.h.

◆ isTen()

bool Poincare::Integer::isTen ( ) const
inline

Definition at line 70 of file integer.h.

◆ isTwo()

bool Poincare::Integer::isTwo ( ) const
inline

Definition at line 69 of file integer.h.

◆ isZero()

bool Poincare::Integer::isZero ( ) const
inline

Definition at line 72 of file integer.h.

◆ Multiplication()

Integer Poincare::Integer::Multiplication ( const Integer i,
const Integer j 
)
static

Definition at line 240 of file integer.cpp.

◆ NaturalOrder()

int Poincare::Integer::NaturalOrder ( const Integer i,
const Integer j 
)
static

Definition at line 212 of file integer.cpp.

◆ numerator()

Integer Poincare::Integer::numerator ( const char *  integralPart,
int  integralPartLength,
const char *  fractionalPart,
int  fractionalPartLength,
bool  negative,
Integer exponent 
)
static

Definition at line 100 of file integer.cpp.

◆ operator=() [1/2]

Integer & Poincare::Integer::operator= ( Integer &&  other)

Definition at line 164 of file integer.cpp.

◆ operator=() [2/2]

Integer & Poincare::Integer::operator= ( const Integer other)

Definition at line 184 of file integer.cpp.

◆ Power()

Integer Poincare::Integer::Power ( const Integer i,
const Integer j 
)
static

Definition at line 313 of file integer.cpp.

◆ setNegative()

void Poincare::Integer::setNegative ( bool  negative)

Definition at line 203 of file integer.cpp.

◆ Subtraction()

Integer Poincare::Integer::Subtraction ( const Integer i,
const Integer j 
)
static

Definition at line 236 of file integer.cpp.

◆ writeTextInBuffer()

int Poincare::Integer::writeTextInBuffer ( char *  buffer,
int  bufferSize 
) const

Definition at line 545 of file integer.cpp.

Member Data Documentation

◆ k_maxExtractableInteger

constexpr int Poincare::Integer::k_maxExtractableInteger = 0x7FFFFFFF
static

Definition at line 73 of file integer.h.

◆ m_digit

native_uint_t Poincare::Integer::m_digit

Definition at line 103 of file integer.h.

◆ m_digits

const native_uint_t* Poincare::Integer::m_digits

Definition at line 102 of file integer.h.


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