FIX::double_conversion::DiyFp Class Reference

Public Member Functions

 DiyFp ()
 DiyFp (uint64_t significand, int exponent)
void Subtract (const DiyFp &other)
void Multiply (const DiyFp &other)
void Normalize ()
uint64_t f () const
int e () const
void set_f (uint64_t new_value)
void set_e (int new_value)

Static Public Member Functions

static DiyFp Minus (const DiyFp &a, const DiyFp &b)
static DiyFp Times (const DiyFp &a, const DiyFp &b)
static DiyFp Normalize (const DiyFp &a)

Static Public Attributes

static const int kSignificandSize = 64

Private Attributes

uint64_t f_
int e_

Static Private Attributes

static const uint64_t kUint64MSB = UINT64_2PART_C(0x80000000, 00000000)

Detailed Description

Definition at line 41 of file FieldConvertors.cpp.

Constructor & Destructor Documentation

◆ DiyFp() [1/2]

FIX::double_conversion::DiyFp::DiyFp ( )
inline

Definition at line 45 of file FieldConvertors.cpp.

◆ DiyFp() [2/2]

FIX::double_conversion::DiyFp::DiyFp ( uint64_t significand,
int exponent )
inline

Definition at line 46 of file FieldConvertors.cpp.

Member Function Documentation

◆ e()

int FIX::double_conversion::DiyFp::e ( ) const
inline

Definition at line 105 of file FieldConvertors.cpp.

135{
136
137// we include "double-conversion" project in FIX namespace
138// to avoid linking errors if quickfix is linked statically
139// and "double-conversion" is already used by target project
140
141#include "double-conversion/diy-fp.cc"
142#include "double-conversion/fixed-dtoa.cc"
143#include "double-conversion/bignum.cc"
144#include "double-conversion/bignum-dtoa.cc"
145#include "double-conversion/cached-powers.cc"
146#include "double-conversion/fast-dtoa.cc"
147#include "double-conversion/strtod.cc"
148#include "double-conversion/double-conversion.cc"
149
150 static double_conversion::DoubleToStringConverter g_dtoa_converter(
151 double_conversion::DoubleToStringConverter::NO_FLAGS,
152 "INF",
153 "NAN",
154 'e',
158 0);
159
160 static double_conversion::StringToDoubleConverter g_atod_converter(
161 double_conversion::StringToDoubleConverter::NO_FLAGS,
162 std::numeric_limits<double>::quiet_NaN(),
163 std::numeric_limits<double>::quiet_NaN(),
164 "INF",
165 "NAN");
166
167 double DoubleConvertor::fast_strtod( const char * buffer, int size, int * processed_chars )
168 {
169 return g_atod_converter.StringToDouble( buffer, size, processed_chars );
170 }
171
172 int DoubleConvertor::fast_dtoa( char * buffer, int size, double value )
173 {
174 double_conversion::StringBuilder builder( buffer, size );
175 if( !g_dtoa_converter.ToPrecision( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
176 {
177 builder.Reset();
178 return 0;
179 }
180
181 builder.TrimTrailingZeros();
182 return builder.position();
183 }
184
185 int DoubleConvertor::fast_fixed_dtoa( char * buffer, int size, double value )
186 {
187 double_conversion::StringBuilder builder( buffer, size );
188 if( !g_dtoa_converter.ToFixed( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
189 {
190 builder.Reset();
191 return 0;
192 }
193
194 return builder.position();
195 }
196
197}
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

◆ f()

uint64_t FIX::double_conversion::DiyFp::f ( ) const
inline

Definition at line 104 of file FieldConvertors.cpp.

134{
135
136// we include "double-conversion" project in FIX namespace
137// to avoid linking errors if quickfix is linked statically
138// and "double-conversion" is already used by target project
139
140#include "double-conversion/diy-fp.cc"
141#include "double-conversion/fixed-dtoa.cc"
142#include "double-conversion/bignum.cc"
143#include "double-conversion/bignum-dtoa.cc"
144#include "double-conversion/cached-powers.cc"
145#include "double-conversion/fast-dtoa.cc"
146#include "double-conversion/strtod.cc"
147#include "double-conversion/double-conversion.cc"
148
149 static double_conversion::DoubleToStringConverter g_dtoa_converter(
150 double_conversion::DoubleToStringConverter::NO_FLAGS,
151 "INF",
152 "NAN",
153 'e',
157 0);
158
159 static double_conversion::StringToDoubleConverter g_atod_converter(
160 double_conversion::StringToDoubleConverter::NO_FLAGS,
161 std::numeric_limits<double>::quiet_NaN(),
162 std::numeric_limits<double>::quiet_NaN(),
163 "INF",
164 "NAN");
165
166 double DoubleConvertor::fast_strtod( const char * buffer, int size, int * processed_chars )
167 {
168 return g_atod_converter.StringToDouble( buffer, size, processed_chars );
169 }
170
171 int DoubleConvertor::fast_dtoa( char * buffer, int size, double value )
172 {
173 double_conversion::StringBuilder builder( buffer, size );
174 if( !g_dtoa_converter.ToPrecision( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
175 {
176 builder.Reset();
177 return 0;
178 }
179
180 builder.TrimTrailingZeros();
181 return builder.position();
182 }
183
184 int DoubleConvertor::fast_fixed_dtoa( char * buffer, int size, double value )
185 {
186 double_conversion::StringBuilder builder( buffer, size );
187 if( !g_dtoa_converter.ToFixed( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
188 {
189 builder.Reset();
190 return 0;
191 }
192
193 return builder.position();
194 }
195
196}

◆ Minus()

DiyFp FIX::double_conversion::DiyFp::Minus ( const DiyFp & a,
const DiyFp & b )
inlinestatic

Definition at line 61 of file FieldConvertors.cpp.

64 {
65 return g_atod_converter.StringToDouble( buffer, size, processed_chars );

◆ Multiply()

void FIX::double_conversion::DiyFp::Multiply ( const DiyFp & other)

Definition at line 35 of file FieldConvertors.cpp.

◆ Normalize() [1/2]

void FIX::double_conversion::DiyFp::Normalize ( )
inline

Definition at line 78 of file FieldConvertors.cpp.

82 {
83 double_conversion::StringBuilder builder( buffer, size );
84 if( !g_dtoa_converter.ToFixed( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
85 {
86 builder.Reset();
87 return 0;
88 }
89
90 return builder.position();
91 }
92
93}

◆ Normalize() [2/2]

DiyFp FIX::double_conversion::DiyFp::Normalize ( const DiyFp & a)
inlinestatic

Definition at line 98 of file FieldConvertors.cpp.

128{
129
130// we include "double-conversion" project in FIX namespace
131// to avoid linking errors if quickfix is linked statically
132// and "double-conversion" is already used by target project
133
134#include "double-conversion/diy-fp.cc"
135#include "double-conversion/fixed-dtoa.cc"
136#include "double-conversion/bignum.cc"
137#include "double-conversion/bignum-dtoa.cc"
138#include "double-conversion/cached-powers.cc"
139#include "double-conversion/fast-dtoa.cc"
140#include "double-conversion/strtod.cc"
141#include "double-conversion/double-conversion.cc"
142
143 static double_conversion::DoubleToStringConverter g_dtoa_converter(
144 double_conversion::DoubleToStringConverter::NO_FLAGS,
145 "INF",
146 "NAN",
147 'e',
151 0);
152
153 static double_conversion::StringToDoubleConverter g_atod_converter(
154 double_conversion::StringToDoubleConverter::NO_FLAGS,
155 std::numeric_limits<double>::quiet_NaN(),
156 std::numeric_limits<double>::quiet_NaN(),
157 "INF",
158 "NAN");
159
160 double DoubleConvertor::fast_strtod( const char * buffer, int size, int * processed_chars )
161 {
162 return g_atod_converter.StringToDouble( buffer, size, processed_chars );
163 }
164
165 int DoubleConvertor::fast_dtoa( char * buffer, int size, double value )
166 {
167 double_conversion::StringBuilder builder( buffer, size );
168 if( !g_dtoa_converter.ToPrecision( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
169 {
170 builder.Reset();
171 return 0;
172 }
173
174 builder.TrimTrailingZeros();
175 return builder.position();
176 }
177
178 int DoubleConvertor::fast_fixed_dtoa( char * buffer, int size, double value )
179 {
180 double_conversion::StringBuilder builder( buffer, size );
181 if( !g_dtoa_converter.ToFixed( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
182 {
183 builder.Reset();
184 return 0;
185 }
186
187 return builder.position();
188 }
189
190}

◆ set_e()

void FIX::double_conversion::DiyFp::set_e ( int new_value)
inline

Definition at line 108 of file FieldConvertors.cpp.

138{
139
140// we include "double-conversion" project in FIX namespace
141// to avoid linking errors if quickfix is linked statically
142// and "double-conversion" is already used by target project
143
144#include "double-conversion/diy-fp.cc"
145#include "double-conversion/fixed-dtoa.cc"
146#include "double-conversion/bignum.cc"
147#include "double-conversion/bignum-dtoa.cc"
148#include "double-conversion/cached-powers.cc"
149#include "double-conversion/fast-dtoa.cc"
150#include "double-conversion/strtod.cc"
151#include "double-conversion/double-conversion.cc"
152
153 static double_conversion::DoubleToStringConverter g_dtoa_converter(
154 double_conversion::DoubleToStringConverter::NO_FLAGS,
155 "INF",
156 "NAN",
157 'e',
161 0);
162
163 static double_conversion::StringToDoubleConverter g_atod_converter(
164 double_conversion::StringToDoubleConverter::NO_FLAGS,
165 std::numeric_limits<double>::quiet_NaN(),
166 std::numeric_limits<double>::quiet_NaN(),
167 "INF",
168 "NAN");
169
170 double DoubleConvertor::fast_strtod( const char * buffer, int size, int * processed_chars )
171 {
172 return g_atod_converter.StringToDouble( buffer, size, processed_chars );
173 }
174
175 int DoubleConvertor::fast_dtoa( char * buffer, int size, double value )
176 {
177 double_conversion::StringBuilder builder( buffer, size );
178 if( !g_dtoa_converter.ToPrecision( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
179 {
180 builder.Reset();
181 return 0;
182 }
183
184 builder.TrimTrailingZeros();
185 return builder.position();
186 }
187
188 int DoubleConvertor::fast_fixed_dtoa( char * buffer, int size, double value )
189 {
190 double_conversion::StringBuilder builder( buffer, size );
191 if( !g_dtoa_converter.ToFixed( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
192 {
193 builder.Reset();
194 return 0;
195 }
196
197 return builder.position();
198 }
199
200}

◆ set_f()

void FIX::double_conversion::DiyFp::set_f ( uint64_t new_value)
inline

Definition at line 107 of file FieldConvertors.cpp.

137{
138
139// we include "double-conversion" project in FIX namespace
140// to avoid linking errors if quickfix is linked statically
141// and "double-conversion" is already used by target project
142
143#include "double-conversion/diy-fp.cc"
144#include "double-conversion/fixed-dtoa.cc"
145#include "double-conversion/bignum.cc"
146#include "double-conversion/bignum-dtoa.cc"
147#include "double-conversion/cached-powers.cc"
148#include "double-conversion/fast-dtoa.cc"
149#include "double-conversion/strtod.cc"
150#include "double-conversion/double-conversion.cc"
151
152 static double_conversion::DoubleToStringConverter g_dtoa_converter(
153 double_conversion::DoubleToStringConverter::NO_FLAGS,
154 "INF",
155 "NAN",
156 'e',
160 0);
161
162 static double_conversion::StringToDoubleConverter g_atod_converter(
163 double_conversion::StringToDoubleConverter::NO_FLAGS,
164 std::numeric_limits<double>::quiet_NaN(),
165 std::numeric_limits<double>::quiet_NaN(),
166 "INF",
167 "NAN");
168
169 double DoubleConvertor::fast_strtod( const char * buffer, int size, int * processed_chars )
170 {
171 return g_atod_converter.StringToDouble( buffer, size, processed_chars );
172 }
173
174 int DoubleConvertor::fast_dtoa( char * buffer, int size, double value )
175 {
176 double_conversion::StringBuilder builder( buffer, size );
177 if( !g_dtoa_converter.ToPrecision( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
178 {
179 builder.Reset();
180 return 0;
181 }
182
183 builder.TrimTrailingZeros();
184 return builder.position();
185 }
186
187 int DoubleConvertor::fast_fixed_dtoa( char * buffer, int size, double value )
188 {
189 double_conversion::StringBuilder builder( buffer, size );
190 if( !g_dtoa_converter.ToFixed( value, DoubleConvertor::SIGNIFICANT_DIGITS, &builder ) )
191 {
192 builder.Reset();
193 return 0;
194 }
195
196 return builder.position();
197 }
198
199}

◆ Subtract()

void FIX::double_conversion::DiyFp::Subtract ( const DiyFp & other)
inline

Definition at line 52 of file FieldConvertors.cpp.

◆ Times()

DiyFp FIX::double_conversion::DiyFp::Times ( const DiyFp & a,
const DiyFp & b )
inlinestatic

Definition at line 72 of file FieldConvertors.cpp.

72 {
73 builder.Reset();
74 return 0;
75 }
76

Member Data Documentation

◆ e_

int FIX::double_conversion::DiyFp::e_
private

Definition at line 114 of file FieldConvertors.cpp.

◆ f_

uint64_t FIX::double_conversion::DiyFp::f_
private

Definition at line 113 of file FieldConvertors.cpp.

◆ kSignificandSize

const int FIX::double_conversion::DiyFp::kSignificandSize = 64
static

Definition at line 43 of file FieldConvertors.cpp.

◆ kUint64MSB

const uint64_t FIX::double_conversion::DiyFp::kUint64MSB = UINT64_2PART_C(0x80000000, 00000000)
staticprivate

Definition at line 111 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