1 #ifndef CARMA_UTIL_FLOAT_STRINGIFIER_H
2 #define CARMA_UTIL_FLOAT_STRINGIFIER_H
11 class FloatStringifier {
15 MAX_CHARS_PER_VALUE = 13
18 explicit FloatStringifier( );
20 virtual ~FloatStringifier( );
22 ::size_t stringifyFloat(
float v,
24 ::
size_t bufferMaxCount );
28 FloatStringifier(
const FloatStringifier & );
29 FloatStringifier & operator=(
const FloatStringifier & );
31 void stringifyFloat(
float v,
char * buffer );
33 double firstScale_[ 0x0100 ];
34 double secondScale_[ 0x0100 ];
36 unsigned short firstBiasedBase10Exponent_[ 0x0100 + 1 ];
38 char leadChunks_[ 100 ][ 3 ];
39 char otherChunks_[ 10000 ][ 4 ];
41 char exponents_[ 621 ][ 4 ];
50 carma::util::FloatStringifier::stringifyFloat(
const float v,
52 const ::size_t bufferMaxCount )
54 if ( bufferMaxCount < MAX_CHARS_PER_VALUE )
57 stringifyFloat( v, buffer );
59 return MAX_CHARS_PER_VALUE;
Exception class for errors.
#define CARMA_ERROR(y)
Trick to get the file name and line number passed to the exception handler.