Project Euler Solutions
Functions | Variables
c::include::bcd Namespace Reference

Functions

void free_BCD_int (BCD_int *const x)
 
BCD_int new_BCD_int1 (const intmax_t a)
 
BCD_int new_BCD_int2 (uintmax_t a, const bool negative)
 
BCD_int copy_BCD_int (BCD_int a)
 
BCD_int BCD_from_bytes (const unsigned char *const str, const size_t chars, const bool negative, const bool little_endian)
 
BCD_int BCD_from_ascii (const char *const str, const size_t digits, const bool negative)
 
BCD_int bcd_error (const BCD_error error, const BCD_error orig_error)
 
comp_t cmp_bcd (const BCD_int x, const BCD_int y)
 
bool bool_bcd (const BCD_int x)
 
bool not_bcd (const BCD_int x)
 
BCD_int sign_bcd (BCD_int x, const bool no_copy, const bool negative)
 
BCD_int abs_bcd (const BCD_int x, const bool no_copy)
 
BCD_int neg_bcd (const BCD_int x, const bool no_copy)
 
BCD_int opp_bcd (const BCD_int x, const bool no_copy)
 
BCD_int add_bcd (const BCD_int x, const BCD_int y)
 
BCD_int inc_bcd (const BCD_int x)
 
BCD_int sub_bcd (const BCD_int x, const BCD_int y)
 
BCD_int dec_bcd (const BCD_int x)
 
BCD_int mul_bcd (const BCD_int x, const BCD_int y)
 
BCD_int div_bcd (const BCD_int x, const BCD_int y)
 
BCD_int mod_bcd (const BCD_int x, const BCD_int y)
 
BCD_int divmod_bcd (const BCD_int x, BCD_int y, BCD_int *mod)
 
BCD_int pow_bcd (const BCD_int x, const BCD_int y)
 
BCD_int factorial_bcd (const BCD_int x)
 
void isign_bcd (BCD_int *const x, const bool negative)
 
void iabs_bcd (BCD_int *const x)
 
void ineg_bcd (BCD_int *const x)
 
void iopp_bcd (BCD_int *const x)
 
void iadd_bcd (BCD_int *const x, const BCD_int y)
 
void iinc_bcd (BCD_int *const x)
 
void isub_bcd (BCD_int *const x, const BCD_int y)
 
void idec_bcd (BCD_int *const x)
 
void imul_bcd (BCD_int *const x, const BCD_int y)
 
void idiv_bcd (BCD_int *const x, const BCD_int y)
 
void imod_bcd (BCD_int *const x, const BCD_int y)
 
void idivmod_bcd (BCD_int *const x, BCD_int *const y)
 
void ipow_bcd (BCD_int *const x, const BCD_int y)
 
void ifactorial_bcd (BCD_int *const x)
 
uintmax_t abs_bcd_cuint (const BCD_int x)
 
intmax_t val_bcd_cint (const BCD_int x)
 
comp_t cmp_bcd_cint (const BCD_int x, const intmax_t y)
 
comp_t cmp_bcd_cuint (const BCD_int x, const uintmax_t y)
 
BCD_int mul_bcd_cint (const BCD_int x, const intmax_t y)
 
BCD_int mul_bcd_cuint (const BCD_int x, uintmax_t y)
 
BCD_int mul_bcd_pow_10 (const BCD_int x, const size_t tens)
 
BCD_int shift_bcd_left (const BCD_int x, const size_t tens)
 
BCD_int div_bcd_pow_10 (const BCD_int a, const size_t tens)
 
BCD_int shift_bcd_right (const BCD_int a, const size_t tens)
 
BCD_int pow_cuint_cuint (const uintmax_t x, uintmax_t y)
 
BCD_int pow_cint_cuint (const intmax_t x, uintmax_t y)
 
void imul_bcd_cuint (BCD_int *const x, const uintmax_t y)
 
void imul_bcd_cint (BCD_int *const x, const intmax_t y)
 
void imul_bcd_pow_10 (BCD_int *const x, const size_t tens)
 
void ishift_bcd_left (BCD_int *const x, const size_t tens)
 
void idiv_bcd_pow_10 (BCD_int *const a, const size_t tens)
 
void ishift_bcd_right (BCD_int *const a, const size_t tens)
 
void print_bcd (const BCD_int x)
 
void print_bcd_ln (const BCD_int x)
 
uint16_t mul_dig_pair (const packed_BCD_pair ab, const packed_BCD_pair cd)
 Multiply a pair of BCD bytes. More...
 

Variables

 EXTERN_PRINTF
 
const BCD_int BCD_two
 The BCD_two constant is used to represent the commonly used value two. More...
 
const BCD_int BCD_one
 The BCD_one constant is used to represent the commonly used value one. More...
 
const BCD_int BCD_zero
 The BCD_zero constant is used to represent the commonly used value zero. More...
 
const BCD_int BCD_nan
 The BCD_nan constant is used to represent the commonly used value NaN. More...
 
enum  comp_t { EQUAL_TO, GREATER_THAN, LESS_THAN, NO_COMP }
 An enum that we return for BCD comparisons. More...
 
enum  BCD_error {
  NON_ERR, ORIG_NAN, IS_FREED, ADD_NAN,
  SUB_NAN, MUL_NAN, DIV_NAN, POW_NAN,
  FACT_NAN, SHIFT_NAN, POW_NEG, FACT_NEG,
  DIV_ZERO, NO_MEM, NOT_SUPP, RESERVED
}
 An enum that we use to track errors in BCD integers. More...
 
typedef uint8_t packed_BCD_pair
 An alias for uint8_t that shows it is intended to store packed BCD data. More...
 

Function Documentation

BCD_int c::include::bcd::abs_bcd ( const BCD_int  x,
const bool  no_copy 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

uintmax_t c::include::bcd::abs_bcd_cuint ( const BCD_int  x)

Here is the caller graph for this function:

BCD_int c::include::bcd::add_bcd ( const BCD_int  x,
const BCD_int  y 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::bcd_error ( const BCD_error  error,
const BCD_error  orig_error 
)
inline

Here is the caller graph for this function:

BCD_int c::include::bcd::BCD_from_ascii ( const char *const  str,
const size_t  digits,
const bool  negative 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::BCD_from_bytes ( const unsigned char *const  str,
const size_t  chars,
const bool  negative,
const bool  little_endian 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool c::include::bcd::bool_bcd ( const BCD_int  x)
inline
comp_t c::include::bcd::cmp_bcd ( const BCD_int  x,
const BCD_int  y 
)

Here is the caller graph for this function:

comp_t c::include::bcd::cmp_bcd_cint ( const BCD_int  x,
const intmax_t  y 
)
inline

Here is the call graph for this function:

comp_t c::include::bcd::cmp_bcd_cuint ( const BCD_int  x,
const uintmax_t  y 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::copy_BCD_int ( BCD_int  a)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::dec_bcd ( const BCD_int  x)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::div_bcd ( const BCD_int  x,
const BCD_int  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::div_bcd_pow_10 ( const BCD_int  a,
const size_t  tens 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::divmod_bcd ( const BCD_int  x,
BCD_int  y,
BCD_int mod 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::factorial_bcd ( const BCD_int  x)

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::free_BCD_int ( BCD_int *const  x)
inline

Here is the caller graph for this function:

void c::include::bcd::iabs_bcd ( BCD_int *const  x)
inline

Here is the call graph for this function:

void c::include::bcd::iadd_bcd ( BCD_int *const  x,
const BCD_int  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::idec_bcd ( BCD_int *const  x)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::idiv_bcd ( BCD_int *const  x,
const BCD_int  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::idiv_bcd_pow_10 ( BCD_int *const  a,
const size_t  tens 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::idivmod_bcd ( BCD_int *const  x,
BCD_int *const  y 
)
inline

Here is the call graph for this function:

void c::include::bcd::ifactorial_bcd ( BCD_int *const  x)

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::iinc_bcd ( BCD_int *const  x)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::imod_bcd ( BCD_int *const  x,
const BCD_int  y 
)
inline

Here is the call graph for this function:

void c::include::bcd::imul_bcd ( BCD_int *const  x,
const BCD_int  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::imul_bcd_cint ( BCD_int *const  x,
const intmax_t  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::imul_bcd_cuint ( BCD_int *const  x,
const uintmax_t  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::imul_bcd_pow_10 ( BCD_int *const  x,
const size_t  tens 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::inc_bcd ( const BCD_int  x)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::ineg_bcd ( BCD_int *const  x)
inline

Here is the call graph for this function:

void c::include::bcd::iopp_bcd ( BCD_int *const  x)
inline

Here is the call graph for this function:

void c::include::bcd::ipow_bcd ( BCD_int *const  x,
const BCD_int  y 
)
inline

Here is the call graph for this function:

void c::include::bcd::ishift_bcd_left ( BCD_int *const  x,
const size_t  tens 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::ishift_bcd_right ( BCD_int *const  a,
const size_t  tens 
)
inline

Here is the call graph for this function:

void c::include::bcd::isign_bcd ( BCD_int *const  x,
const bool  negative 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::isub_bcd ( BCD_int *const  x,
const BCD_int  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::mod_bcd ( const BCD_int  x,
const BCD_int  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::mul_bcd ( const BCD_int  x,
const BCD_int  y 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::mul_bcd_cint ( const BCD_int  x,
const intmax_t  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::mul_bcd_cuint ( const BCD_int  x,
uintmax_t  y 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::mul_bcd_pow_10 ( const BCD_int  x,
const size_t  tens 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::neg_bcd ( const BCD_int  x,
const bool  no_copy 
)
inline

Here is the call graph for this function:

BCD_int c::include::bcd::new_BCD_int1 ( const intmax_t  a)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::new_BCD_int2 ( uintmax_t  a,
const bool  negative 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool c::include::bcd::not_bcd ( const BCD_int  x)
inline
BCD_int c::include::bcd::opp_bcd ( const BCD_int  x,
const bool  no_copy 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::pow_bcd ( const BCD_int  x,
const BCD_int  y 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::pow_cint_cuint ( const intmax_t  x,
uintmax_t  y 
)
inline

Here is the call graph for this function:

BCD_int c::include::bcd::pow_cuint_cuint ( const uintmax_t  x,
uintmax_t  y 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

void c::include::bcd::print_bcd ( const BCD_int  x)

Here is the caller graph for this function:

void c::include::bcd::print_bcd_ln ( const BCD_int  x)
inline

Here is the call graph for this function:

BCD_int c::include::bcd::shift_bcd_left ( const BCD_int  x,
const size_t  tens 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::shift_bcd_right ( const BCD_int  a,
const size_t  tens 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::sign_bcd ( BCD_int  x,
const bool  no_copy,
const bool  negative 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

BCD_int c::include::bcd::sub_bcd ( const BCD_int  x,
const BCD_int  y 
)

Here is the call graph for this function:

Here is the caller graph for this function:

intmax_t c::include::bcd::val_bcd_cint ( const BCD_int  x)

Here is the call graph for this function:

Variable Documentation

c::include::bcd::EXTERN_PRINTF