42 #define MAXPRECISION 50
46 {2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9,
47 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15,
48 16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21,
49 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26};
55 bool needs_del=
false;
57 if(prec == 0)
return 0;
63 memset (cs_num, 0, prec);
66 unsigned char*
number = &cs_num[BYTE_NUM - 1];
72 while (l_num != 0 &&
number >= cs_num) {
74 *
number = (
unsigned char)rem;
78 if (needs_del)
delete[] cs_num;
98 for (
int i = 1;
i < BYTE_NUM;
i++) {
102 my_long = my_long*256 + cs_num[
i];
104 if (cs_num[0] != 0) {
121 for(
i= 0, j= BYTE_NUM-1;
i < j;
i++, j--) {
Include a standard set of the NCBI C++ Toolkit most basic headers.
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_DBAPIDRIVER_EXPORT
unsigned char * longlong_to_numeric(Int8 l_num, unsigned int prec, unsigned char *cs_num)
static int s_NumericBytesPerPrec[]
Int8 numeric_to_longlong(unsigned int precision, unsigned char *cs_num)
void swap_numeric_endian(unsigned int precision, unsigned char *num)