114{
117
118 _ASSERTE(mantissa_buffer_count > 0);
119
121
122
123
124
125
126 bool const is_denormal = value_components._exponent == 0;
127
128 uint64_t const mantissa_adjustment = is_denormal
129 ? 0
130 :
static_cast<uint64_t>(1) << (floating_traits::mantissa_bits - 1);
131
132 int32_t const exponent_adjustment = is_denormal
133 ? 2
134 : 1;
135
136
137
138
139 uint64_t const f = value_components._mantissa + mantissa_adjustment;
141 static_cast<int32_t>(value_components._exponent) -
142 floating_traits::exponent_bias -
143 floating_traits::mantissa_bits +
144 exponent_adjustment;
145
146
147
148
149
150
151
154 {
155 _ASSERTE((
"unexpected input value; log10 failed", 0));
157 }
158
159
160
161
164
166 {
168 {
171 }
172 else
173 {
176 }
177 }
178 else
179 {
180 if (
e == floating_traits::minimum_binary_exponent ||
182 {
185 }
186 else
187 {
190 }
191 }
192
194 {
196 }
197 else
198 {
200 }
201
202 char* mantissa_it = mantissa_buffer;
203
204
205
206
209
210
211
212
213
214 if (initial_digit == 10)
215 {
217 *mantissa_it++ = '1';
219 }
220
221
222
223 else if (initial_digit == 0)
224 {
226 }
227
228
229 else
230 {
231 *mantissa_it++ = static_cast<char>('0' + initial_digit);
232 }
233
235
236
237
238
242
243 char*
const mantissa_last = mantissa_buffer +
__min(mantissa_buffer_count - 1, required_digits);
244
245
246
247
248 bool unwritten_nonzero_digits_in_chunk = false;
249 for (;;)
250 {
251 if (mantissa_it == mantissa_last)
252 {
253 break;
254 }
255
257 {
258 break;
259 }
260
261
262
263
264
265 uint32_t const digits_per_iteration = 9;
266 uint32_t const digits_per_iteration_multiplier = 1000 * 1000 * 1000;
267
268 multiply(
r, digits_per_iteration_multiplier);
270
271 _ASSERTE(quotient < digits_per_iteration_multiplier);
272
273
274
275 #pragma warning(suppress: 6293)
277 {
278 char const d =
static_cast<char>(
'0' + quotient % 10);
279 quotient /= 10;
280
281
282
283
284 if (
static_cast<uint32_t>(mantissa_last - mantissa_it) <=
i)
285 {
287 {
288 unwritten_nonzero_digits_in_chunk = true;
289 }
290
291 continue;
292 }
293
295 }
296
297 mantissa_it +=
__min(digits_per_iteration, mantissa_last - mantissa_it);
298 }
299
300 *mantissa_it = '\0';
301
302
303
304
305 bool const all_zeros_after_chunk =
is_zero(
r);
306
307 if (all_zeros_after_chunk && !unwritten_nonzero_digits_in_chunk)
308 {
310 }
311
313}
GLdouble GLdouble GLdouble r
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP double __cdecl ceil(_In_ double x)
__forceinline bool __cdecl is_zero(big_integer const &value)
__forceinline big_integer __cdecl make_big_integer(uint64_t const value)
uint64_t __cdecl divide(big_integer &numerator, big_integer const &denominator)
__forceinline bool __cdecl multiply(big_integer &multiplicand, uint32_t const multiplier)
__forceinline bool __cdecl multiply_by_power_of_ten(big_integer &x, uint32_t const power)
__forceinline bool __cdecl shift_left(big_integer &x, uint32_t const n)
__forceinline big_integer __cdecl make_big_integer_power_of_two(uint32_t const power)