Library for big numbers from http://www.ttmath.org/

Dependents:   PIDHeater82 Conceptcontroller_v_1_0 AlarmClockApp COG4050_adxl355_tilt ... more

Embed: (wiki syntax)

« Back to documentation index

Misc Class Reference

Misc Class Reference

#include <ttmathmisc.h>

Static Public Member Functions

static void AssignString (std::string &result, const char *str)
static void AssignString (std::wstring &result, const char *str)
static void AssignString (std::wstring &result, const std::string &str)
static void AssignString (std::string &result, const wchar_t *str)
static void AssignString (std::string &result, const std::wstring &str)
static void AddString (std::string &result, const char *str)
static void AddString (std::wstring &result, const char *str)
static uint CharToDigit (uint c)
static sint CharToDigit (uint c, uint base)
static uint DigitToChar (uint digit)

Detailed Description

some helpful functions

Definition at line 57 of file ttmathmisc.h.


Member Function Documentation

static void AddString ( std::string &  result,
const char *  str 
) [static]

result += str

Definition at line 135 of file ttmathmisc.h.

static void AddString ( std::wstring &  result,
const char *  str 
) [static]

result += str

Definition at line 146 of file ttmathmisc.h.

static void AssignString ( std::wstring &  result,
const char *  str 
) [static]

result = str

Definition at line 83 of file ttmathmisc.h.

static void AssignString ( std::string &  result,
const wchar_t *  str 
) [static]

result = str

Definition at line 104 of file ttmathmisc.h.

static void AssignString ( std::string &  result,
const std::wstring &  str 
) [static]

result = str

Definition at line 116 of file ttmathmisc.h.

static void AssignString ( std::string &  result,
const char *  str 
) [static]

result = str

Definition at line 72 of file ttmathmisc.h.

static void AssignString ( std::wstring &  result,
const std::string &  str 
) [static]

result = str

Definition at line 95 of file ttmathmisc.h.

static uint CharToDigit ( uint  c ) [static]

this static method converts one character into its value

for example: 1 -> 1 8 -> 8 A -> 10 f -> 15

this method don't check whether c is correct or not

Definition at line 181 of file ttmathmisc.h.

static sint CharToDigit ( uint  c,
uint  base 
) [static]

this method changes a character 'c' into its value (if there can't be a correct value it returns -1)

for example: c=2, base=10 -> function returns 2 c=A, base=10 -> function returns -1 c=A, base=16 -> function returns 10

Definition at line 202 of file ttmathmisc.h.

static uint DigitToChar ( uint  digit ) [static]

this method converts a digit into a char digit should be from <0,F> (we don't have to get a base)

for example: 1 -> 1 8 -> 8 10 -> A 15 -> F

Definition at line 236 of file ttmathmisc.h.