NCBI C++ ToolKit
Macros | Functions | Variables
numeric_convert.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbistd.hpp>
#include <string>
#include <stdio.h>
+ Include dependency graph for numeric_convert.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define MAXPRECISION   50
 

Functions

unsigned char * longlong_to_numeric (Int8 l_num, unsigned int prec, unsigned char *cs_num)
 
Int8 numeric_to_longlong (unsigned int precision, unsigned char *cs_num)
 
void swap_numeric_endian (unsigned int precision, unsigned char *num)
 

Variables

static int s_NumericBytesPerPrec []
 

Macro Definition Documentation

◆ MAXPRECISION

#define MAXPRECISION   50

Definition at line 42 of file numeric_convert.cpp.

Function Documentation

◆ longlong_to_numeric()

unsigned char* longlong_to_numeric ( Int8  l_num,
unsigned int  prec,
unsigned char *  cs_num 
)

◆ numeric_to_longlong()

Int8 numeric_to_longlong ( unsigned int  precision,
unsigned char *  cs_num 
)

Definition at line 89 of file numeric_convert.cpp.

References i, kMax_I8, precision, and s_NumericBytesPerPrec.

Referenced by CTL_RowResult::GetItemInternal().

◆ swap_numeric_endian()

void swap_numeric_endian ( unsigned int  precision,
unsigned char *  num 
)

Definition at line 113 of file numeric_convert.cpp.

References i, precision, and s_NumericBytesPerPrec.

Referenced by xConvert2CDB_Numeric().

Variable Documentation

◆ s_NumericBytesPerPrec

int s_NumericBytesPerPrec[]
static
Initial value:
=
{2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9,
10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15,
16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21,
22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26}

Definition at line 45 of file numeric_convert.cpp.

Referenced by longlong_to_numeric(), numeric_to_longlong(), and swap_numeric_endian().

Modified on Wed May 15 15:05:25 2024 by modify_doxy.py rev. 669887