FIX::double_conversion::PowersOfTenCache Class Reference

Static Public Member Functions

static void GetCachedPowerForBinaryExponentRange (int min_exponent, int max_exponent, DiyFp *power, int *decimal_exponent)
static void GetCachedPowerForDecimalExponent (int requested_exponent, DiyFp *power, int *found_exponent)

Static Public Attributes

static const int kDecimalExponentDistance = 8
static const int kMinDecimalExponent = -348
static const int kMaxDecimalExponent = 340

Detailed Description

Definition at line 35 of file FieldConvertors.cpp.

Member Function Documentation

◆ GetCachedPowerForBinaryExponentRange()

void FIX::double_conversion::PowersOfTenCache::GetCachedPowerForBinaryExponentRange ( int min_exponent,
int max_exponent,
DiyFp * power,
int * decimal_exponent )
static

Definition at line 142 of file FieldConvertors.cpp.

172{
173
174// we include "double-conversion" project in FIX namespace
175// to avoid linking errors if quickfix is linked statically
176// and "double-conversion" is already used by target project
177
178#include "double-conversion/diy-fp.cc"
179#include "double-conversion/fixed-dtoa.cc"
180#include "double-conversion/bignum.cc"
181#include "double-conversion/bignum-dtoa.cc"
182#include "double-conversion/cached-powers.cc"
183#include "double-conversion/fast-dtoa.cc"
184#include "double-conversion/strtod.cc"
185#include "double-conversion/double-conversion.cc"
186
187 static double_conversion::DoubleToStringConverter g_dtoa_converter(
188 double_conversion::DoubleToStringConverter::NO_FLAGS,
189 "INF",
190 "NAN",
191 'e',
195 0);
196
197 static double_conversion::StringToDoubleConverter g_atod_converter(
198 double_conversion::StringToDoubleConverter::NO_FLAGS,
199 std::numeric_limits<double>::quiet_NaN(),
200 std::numeric_limits<double>::quiet_NaN(),
201 "INF",
202 "NAN");
203
204 double DoubleConvertor::fast_strtod( const char * buffer, int size, int * processed_chars )
205 {
206 return g_atod_converter.StringToDouble( buffer, size, processed_chars );
207 }
208
209 int DoubleConvertor::fast_dtoa( char * buffer, int size, double value )
210 {
211 double_conversion::StringBuilder builder( buffer, size );
212 if( !g_dtoa_converter.ToPrecision( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
213 {
214 builder.Reset();
215 return 0;
216 }
217
218 builder.TrimTrailingZeros();
219 return builder.position();
220 }
221
222 int DoubleConvertor::fast_fixed_dtoa( char * buffer, int size, double value )
223 {
224 double_conversion::StringBuilder builder( buffer, size );
225 if( !g_dtoa_converter.ToFixed( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
226 {
227 builder.Reset();
228 return 0;
229 }
230
231 return builder.position();
232 }
233
234}
static double_conversion::StringToDoubleConverter g_atod_converter(double_conversion::StringToDoubleConverter::NO_FLAGS, std::numeric_limits< double >::quiet_NaN(), std::numeric_limits< double >::quiet_NaN(), "INF", "NAN")
static double_conversion::DoubleToStringConverter g_dtoa_converter(double_conversion::DoubleToStringConverter::NO_FLAGS, "INF", "NAN", 'e', -DoubleConvertor::SIGNIFICANT_DIGITS, DoubleConvertor::SIGNIFICANT_DIGITS, DoubleConvertor::SIGNIFICANT_DIGITS - 1, 0)
static int fast_fixed_dtoa(char *buffer, int size, double value)
static double fast_strtod(const char *buffer, int size, int *processed_chars)
static int fast_dtoa(char *buffer, int size, double value)
static const int SIGNIFICANT_DIGITS

◆ GetCachedPowerForDecimalExponent()

void FIX::double_conversion::PowersOfTenCache::GetCachedPowerForDecimalExponent ( int requested_exponent,
DiyFp * power,
int * found_exponent )
static

Definition at line 162 of file FieldConvertors.cpp.

192{
193
194// we include "double-conversion" project in FIX namespace
195// to avoid linking errors if quickfix is linked statically
196// and "double-conversion" is already used by target project
197
198#include "double-conversion/diy-fp.cc"
199#include "double-conversion/fixed-dtoa.cc"
200#include "double-conversion/bignum.cc"
201#include "double-conversion/bignum-dtoa.cc"
202#include "double-conversion/cached-powers.cc"
203#include "double-conversion/fast-dtoa.cc"
204#include "double-conversion/strtod.cc"
205#include "double-conversion/double-conversion.cc"
206
207 static double_conversion::DoubleToStringConverter g_dtoa_converter(
208 double_conversion::DoubleToStringConverter::NO_FLAGS,
209 "INF",
210 "NAN",
211 'e',
215 0);
216
217 static double_conversion::StringToDoubleConverter g_atod_converter(
218 double_conversion::StringToDoubleConverter::NO_FLAGS,
219 std::numeric_limits<double>::quiet_NaN(),
220 std::numeric_limits<double>::quiet_NaN(),
221 "INF",
222 "NAN");
223
224 double DoubleConvertor::fast_strtod( const char * buffer, int size, int * processed_chars )
225 {
226 return g_atod_converter.StringToDouble( buffer, size, processed_chars );
227 }
228
229 int DoubleConvertor::fast_dtoa( char * buffer, int size, double value )
230 {
231 double_conversion::StringBuilder builder( buffer, size );
232 if( !g_dtoa_converter.ToPrecision( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
233 {
234 builder.Reset();
235 return 0;
236 }
237
238 builder.TrimTrailingZeros();
239 return builder.position();
240 }
241
242 int DoubleConvertor::fast_fixed_dtoa( char * buffer, int size, double value )
243 {
244 double_conversion::StringBuilder builder( buffer, size );
245 if( !g_dtoa_converter.ToFixed( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
246 {
247 builder.Reset();
248 return 0;
249 }
250
251 return builder.position();
252 }
253
254}

Member Data Documentation

◆ kDecimalExponentDistance

const int FIX::double_conversion::PowersOfTenCache::kDecimalExponentDistance = 8
static

Definition at line 40 of file FieldConvertors.cpp.

◆ kMaxDecimalExponent

const int FIX::double_conversion::PowersOfTenCache::kMaxDecimalExponent = 340
static

Definition at line 43 of file FieldConvertors.cpp.

◆ kMinDecimalExponent

const int FIX::double_conversion::PowersOfTenCache::kMinDecimalExponent = -348
static

Definition at line 42 of file FieldConvertors.cpp.


The documentation for this class was generated from the following file:

Generated on for QuickFIX by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2001