102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
decimal_conversion.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
8#include <intrin.h>
9#include <math.h>
10#include <stdarg.h>
11#include <string.h>
12#define nullptr 0
13
14// Original pcdogs.exe: 0x44c13e
15// Parses decimal text into the CRT's packed extended representation and updates the end pointer. Status values distinguish success, underflow, overflow, and a missing mantissa, while locale punctuation and legacy rounding rules remain intact.
16int32_t __strgtold12(struct CRT_LD12Fields *output, const char **end_pointer, char const *text, int32_t mult12, int32_t scale, int32_t decimal_point, int32_t implicit_exponent)
17{
18 char const *cursor = text;
20 uint8_t *digit_write = (uint8_t *)(&digits);
22 uint16_t sign_bit = 0;
23 int32_t exponent_sign = 1;
24 uint32_t digit_count = 0;
25 int32_t saw_mantissa_digit = 0;
26 int32_t saw_decimal_point = 0;
27 int32_t saw_exponent_digits = 0;
28 int32_t exponent_overflow = 0;
29 int32_t exponent_underflow = 0;
30 int32_t exponent_magnitude = 0;
31 int32_t decimal_adjustment = 0;
33
34 while (true)
35 {
36 char const leading_character = *(uint8_t *)cursor;
37
38 if (leading_character != ' ' && leading_character != '\t' && leading_character != '\n' && leading_character != '\r')
39 {
40 while (true)
41 {
42 char character = *(uint8_t *)cursor;
43
44 cursor = &cursor[1];
45
46 char const *exponent_start;
47
48 switch (parser_state)
49 {
51 break;
52
54 {
55 if (character >= '1' && character <= '9')
56 {
57 parser_state = CRT_DECIMAL_PARSE_INTEGER;
58 cursor -= 1;
59
60 continue;
61 }
62 else if (character != g_decimalPointChar)
63 {
64 int32_t sign_character = (int32_t)character;
65
66 if (sign_character == '+')
67 {
68 sign_bit = 0;
69 parser_state = CRT_DECIMAL_PARSE_AFTER_SIGN;
70
71 continue;
72 }
73 else if (sign_character == '-')
74 {
75 sign_bit = CRT_EXTENDED_SIGN_MASK;
76 parser_state = CRT_DECIMAL_PARSE_AFTER_SIGN;
77
78 continue;
79 }
80 else
81 {
82 if (sign_character != '0')
83 {
84 cursor -= 1;
85
86 break;
87 }
88
89 parser_state = CRT_DECIMAL_PARSE_LEADING_ZERO;
90
91 continue;
92 }
93 }
94 else
95 {
97
98 continue;
99 }
100
101 break;
102 }
103
105 {
106 saw_mantissa_digit = 1;
107
108 if (character >= '1' && character <= '9')
109 {
110 parser_state = CRT_DECIMAL_PARSE_INTEGER;
111 cursor -= 1;
112
113 continue;
114 }
115
116 if (character == g_decimalPointChar)
117 {
118 parser_state = CRT_DECIMAL_PARSE_FRACTION;
119
120 continue;
121 }
122 else if (character == '+' || character == '-')
123 {
124 cursor -= 1;
126
127 continue;
128 }
129 else if (character == '0')
130 {
131 parser_state = CRT_DECIMAL_PARSE_LEADING_ZERO;
132
133 continue;
134 }
135 else
136 {
137 if (character <= 'C' || (character > 'E' && (character <= 'c' || character > 'e')))
138 {
139 cursor -= 1;
140
141 break;
142 }
143
145
146 continue;
147 }
148
149 break;
150 }
151
153 {
154 if (character >= '1' && character <= '9')
155 {
156 parser_state = CRT_DECIMAL_PARSE_INTEGER;
157 cursor -= 1;
158
159 continue;
160 }
161
162 if (character == g_decimalPointChar)
163 {
164 parser_state = CRT_DECIMAL_PARSE_LEADING_POINT;
165
166 continue;
167 }
168
169 if (character != '0')
170 {
171 cursor = text;
172
173 break;
174 }
175
176 parser_state = CRT_DECIMAL_PARSE_LEADING_ZERO;
177
178 continue;
179 }
180
182 {
183 saw_mantissa_digit = 1;
184
185 while (true)
186 {
187 int32_t is_integer_digit;
188
189 if (g_crtLcCodepage <= 1)
190 {
191 uint32_t integer_class_bits = (uint32_t)(uint8_t)character;
192
193 is_integer_digit = ((struct CRT_CharacterClass *)g_pCharTypeTable)[integer_class_bits].classification_flags & CRT_CTYPE_DIGIT;
194 }
195 else
196 is_integer_digit = CRT_isctype((uint32_t)(uint8_t)character, CRT_CTYPE_DIGIT);
197
198 if (!is_integer_digit)
199 break;
200
201 if (digit_count >= CRT_DECIMAL_PARSE_DIGIT_CAPACITY)
202 decimal_adjustment += 1;
203 else
204 {
205 uint8_t *integer_digit_slot = digit_write;
206
207 digit_count += 1;
208 digit_write = &digit_write[1];
209 *(uint8_t *)integer_digit_slot = character - '0';
210 }
211
212 character = *(uint8_t *)cursor;
213 cursor = &cursor[1];
214 }
215
216 if (character == g_decimalPointChar)
217 {
218 parser_state = CRT_DECIMAL_PARSE_FRACTION;
219
220 continue;
221 }
222
223 if (character == '+' || character == '-')
224 {
225 cursor -= 1;
227
228 continue;
229 }
230 {
231 if (character <= 'C' || (character > 'E' && (character <= 'c' || character > 'e')))
232 {
233 cursor -= 1;
234
235 break;
236 }
237
239
240 continue;
241 }
242 }
243
245 {
246 saw_mantissa_digit = 1;
247 saw_decimal_point = 1;
248
249 if (!digit_count)
250 {
251 while (character == '0')
252 {
253 decimal_adjustment -= 1;
254 character = *(uint8_t *)cursor;
255 cursor = &cursor[1];
256 }
257 }
258
259 while (true)
260 {
261 int32_t is_fraction_digit;
262
263 if (g_crtLcCodepage <= 1)
264 {
265 uint32_t fraction_class_bits = (uint32_t)(uint8_t)character;
266
267 is_fraction_digit = ((struct CRT_CharacterClass *)g_pCharTypeTable)[fraction_class_bits].classification_flags & CRT_CTYPE_DIGIT;
268 }
269 else
270 is_fraction_digit = CRT_isctype((uint32_t)(uint8_t)character, CRT_CTYPE_DIGIT);
271
272 if (!is_fraction_digit)
273 break;
274
275 if (digit_count < CRT_DECIMAL_PARSE_DIGIT_CAPACITY)
276 {
277 uint8_t *fraction_digit_slot = digit_write;
278
279 digit_count += 1;
280 digit_write = &digit_write[1];
281 decimal_adjustment -= 1;
282 *(uint8_t *)fraction_digit_slot = character - '0';
283 }
284
285 character = *(uint8_t *)cursor;
286 cursor = &cursor[1];
287 }
288 {
289 if (character == '+' || character == '-')
290 {
291 cursor -= 1;
293
294 continue;
295 }
296
297 if (character <= 'C' || (character > 'E' && (character <= 'c' || character > 'e')))
298 {
299 cursor -= 1;
300
301 break;
302 }
303
305
306 continue;
307 }
308 }
309
311 {
312 saw_decimal_point = 1;
313
314 int32_t is_initial_fraction_digit;
315
316 if (g_crtLcCodepage <= 1)
317 {
318 uint32_t initial_fraction_class_bits = (uint32_t)(uint8_t)character;
319
320 is_initial_fraction_digit = ((struct CRT_CharacterClass *)g_pCharTypeTable)[initial_fraction_class_bits].classification_flags & CRT_CTYPE_DIGIT;
321 }
322 else
323 is_initial_fraction_digit = CRT_isctype((uint32_t)(uint8_t)character, CRT_CTYPE_DIGIT);
324
325 if (!is_initial_fraction_digit)
326 {
327 cursor = text;
328
329 break;
330 }
331
332 parser_state = CRT_DECIMAL_PARSE_FRACTION;
333 cursor -= 1;
334
335 continue;
336 }
337
339 {
340 exponent_start = &cursor[-2];
341 text = exponent_start;
342
343 if (character >= '1' && character <= '9')
344 {
346 cursor -= 1;
347
348 continue;
349 }
350
351 int32_t exponent_sign_character = (int32_t)character;
352
353 if (exponent_sign_character == '+')
354 {
355 parser_state = CRT_DECIMAL_PARSE_EXPONENT_SIGN;
356
357 continue;
358 }
359
360 if (exponent_sign_character == '-')
361 {
362 exponent_sign = 0xffffffff;
363 parser_state = CRT_DECIMAL_PARSE_EXPONENT_SIGN;
364
365 continue;
366 }
367
368 if (exponent_sign_character == '0')
369 {
370 parser_state = CRT_DECIMAL_PARSE_EXPONENT_ZERO;
371
372 continue;
373 }
374
375 cursor = exponent_start;
376
377 break;
378 }
379
381 {
382 if (character >= '1' && character <= '9')
383 {
385 cursor -= 1;
386
387 continue;
388 }
389
390 if (character != '0')
391 {
392 cursor = text;
393
394 break;
395 }
396
397 parser_state = CRT_DECIMAL_PARSE_EXPONENT_ZERO;
398
399 continue;
400 }
401
403 {
404 saw_exponent_digits = 1;
405
406 while (character == '0')
407 {
408 character = *(uint8_t *)cursor;
409 cursor = &cursor[1];
410 }
411
412 if (character >= '1' && character <= '9')
413 {
415 cursor -= 1;
416
417 continue;
418 }
419
420 cursor -= 1;
421
422 break;
423 }
424
426 {
427 saw_exponent_digits = 1;
428
429 int32_t parsed_exponent_magnitude = 0;
430
431 while (true)
432 {
433 int32_t is_exponent_digit;
434
435 if (g_crtLcCodepage <= 1)
436 {
437 uint32_t exponent_class_bits = (uint32_t)(uint8_t)character;
438
439 is_exponent_digit = ((struct CRT_CharacterClass *)g_pCharTypeTable)[exponent_class_bits].classification_flags & CRT_CTYPE_DIGIT;
440 }
441 else
442 is_exponent_digit = CRT_isctype((uint32_t)(uint8_t)character, CRT_CTYPE_DIGIT);
443
444 if (!is_exponent_digit)
445 break;
446
447 parsed_exponent_magnitude = (int32_t)character + parsed_exponent_magnitude * 0xa - '0';
448
449 if (parsed_exponent_magnitude > CRT_DECIMAL_EXPONENT_LIMIT)
450 {
451 parsed_exponent_magnitude = (CRT_DECIMAL_EXPONENT_LIMIT + 1);
452
453 break;
454 }
455
456 character = *(uint8_t *)cursor;
457 cursor = &cursor[1];
458 }
459
460 exponent_magnitude = parsed_exponent_magnitude;
461
462 while (true)
463 {
464 int32_t is_excess_exponent_digit;
465
466 if (g_crtLcCodepage <= 1)
467 {
468 uint32_t excess_exponent_class_bits = (uint32_t)(uint8_t)character;
469
470 is_excess_exponent_digit = ((struct CRT_CharacterClass *)g_pCharTypeTable)[excess_exponent_class_bits].classification_flags & CRT_CTYPE_DIGIT;
471 }
472 else
473 is_excess_exponent_digit = CRT_isctype((uint32_t)(uint8_t)character, CRT_CTYPE_DIGIT);
474
475 if (!is_excess_exponent_digit)
476 break;
477
478 character = *(uint8_t *)cursor;
479 cursor = &cursor[1];
480 }
481
482 cursor -= 1;
483
484 break;
485 }
486
488 {
489 if (!implicit_exponent)
490 {
491 cursor -= 1;
492 parser_state = CRT_DECIMAL_PARSE_DONE;
493 }
494 else
495 {
496 int32_t implicit_sign_character = (int32_t)character;
497
498 exponent_start = &cursor[-1];
499 text = exponent_start;
500
501 if (implicit_sign_character == '+')
502 {
503 parser_state = CRT_DECIMAL_PARSE_EXPONENT_SIGN;
504
505 continue;
506 }
507
508 if (implicit_sign_character != '-')
509 {
510 cursor = exponent_start;
511
512 break;
513 }
514
515 exponent_sign = 0xffffffff;
516 parser_state = CRT_DECIMAL_PARSE_EXPONENT_SIGN;
517
518 continue;
519 }
520
521 break;
522 }
523 }
524
525 break;
526 }
527
528 *end_pointer = cursor;
529
530 int16_t sign_exponent;
531 uint16_t extra_mantissa;
532 uint32_t mantissa_low;
533 uint32_t mantissa_high;
534
535 if (!saw_mantissa_digit)
536 {
537 extra_mantissa = 0;
538 sign_exponent = 0;
539 mantissa_high = 0;
540 mantissa_low = 0;
541 parse_status = CRT_DECIMAL_NO_MANTISSA;
542 }
543 else
544 {
545 uint8_t *trim_cursor;
546
547 if (digit_count <= CRT_DECIMAL_PARSE_DIGIT_LIMIT)
548 trim_cursor = digit_write;
549 else
550 {
551 if (digits[CRT_DECIMAL_PARSE_DIGIT_LIMIT - 1] >= 5)
552 digits[CRT_DECIMAL_PARSE_DIGIT_LIMIT - 1] += 1;
553
554 digit_count = CRT_DECIMAL_PARSE_DIGIT_LIMIT;
555 trim_cursor = digit_write - 1;
556 decimal_adjustment += 1;
557 }
558
559 if (digit_count <= 0)
560 {
561 extra_mantissa = 0;
562 sign_exponent = 0;
563 mantissa_high = 0;
564 mantissa_low = 0;
565 }
566 else
567 {
568 while (true)
569 {
570 trim_cursor -= 1;
571
572 if (*(uint8_t *)trim_cursor)
573 break;
574
575 digit_count -= 1;
576 decimal_adjustment += 1;
577 }
578
579 struct CRT_LD12Fields parsed_value;
580
581 __mtold12((const uint8_t *)(&digits), digit_count, &parsed_value);
582
583 int32_t signed_exponent = exponent_magnitude;
584
585 if (exponent_sign < 0)
586 signed_exponent = -(signed_exponent);
587
588 int32_t power = signed_exponent + decimal_adjustment;
589
590 if (!saw_exponent_digits)
591 power += scale;
592
593 if (!saw_decimal_point)
594 power -= decimal_point;
595
596 if (power <= CRT_DECIMAL_EXPONENT_LIMIT)
597 {
598 if (power < -CRT_DECIMAL_EXPONENT_LIMIT)
599 {
600 exponent_underflow = 1;
601 }
602 else
603 {
604 __flt_power10(&parsed_value, power, mult12);
605 extra_mantissa = parsed_value.extra_mantissa;
606
607 mantissa_low = parsed_value.mantissa_low;
608 mantissa_high = parsed_value.mantissa_high;
609 sign_exponent = (int16_t)parsed_value.sign_exponent;
610 }
611 }
612 else
613 {
614 exponent_overflow = 1;
615 }
616 }
617
618 if (exponent_overflow)
619 {
620 mantissa_low = 0;
623 extra_mantissa = 0;
624 parse_status = CRT_DECIMAL_OVERFLOW;
625 }
626 else if (exponent_underflow)
627 {
628 extra_mantissa = 0;
629 sign_exponent = 0;
630 mantissa_high = 0;
631 mantissa_low = 0;
632 parse_status = CRT_DECIMAL_UNDERFLOW;
633 }
634 }
635
636 output->mantissa_high = (uint32_t)mantissa_high;
637 output->mantissa_low = (uint32_t)mantissa_low;
638 output->sign_exponent = sign_exponent | sign_bit;
640
641 return parse_status;
642 }
643
644 cursor = &cursor[1];
645 }
646}
647
648// Original pcdogs.exe: 0x44c60f
649// Converts an 80-bit extended value passed in a 12-byte argument slot into decimal digits, sign, and decimal-point position. It emits the CRT's special-value tokens and reports whether the input is finite.
650BOOL String_ConvertToDecimalStringFloat(struct CRT_Extended80Argument value, int32_t digit_count, uint32_t format_flags, struct CRT_DecimalFloatOutput *output)
651{
652 uint16_t sign_exponent = value.signExponent;
653 int16_t sign_bit = sign_exponent & CRT_EXTENDED_SIGN_MASK;
654 int16_t binary_exponent = sign_exponent & CRT_EXTENDED_EXPONENT_MASK;
655 struct CRT_LD12Fields right;
656
661
662 int32_t result = 1;
663
664 if (!sign_bit)
665 output->signCharacter = ' ';
666 else
667 output->signCharacter = '-';
668
669 uint32_t mantissa_high = value.mantissaHigh;
670
671 if (!binary_exponent && !mantissa_high && value.mantissaLow == mantissa_high)
672 {
673 output->decimalPointPosition = 0;
674 output->signCharacter = ' ';
675 output->digitCount = 1;
676 output->digits[0] = '0';
677 output->digits[1] = 0;
678
679 return 1;
680 }
681
682 if (binary_exponent == CRT_EXTENDED_EXPONENT_MASK)
683 {
684 output->decimalPointPosition = 1;
685
687 {
688 CRT_strcpy(output->digits, "1#SNAN");
689 output->digitCount = 6;
690 }
692 {
693 if (value.mantissaLow)
694 {
695 CRT_strcpy(output->digits, "1#QNAN");
696 output->digitCount = 6;
697
698 return 0;
699 }
700
701 CRT_strcpy(output->digits, "1#IND");
702 output->digitCount = 5;
703 }
705 {
706 CRT_strcpy(output->digits, "1#QNAN");
707 output->digitCount = 6;
708 }
709 else
710 {
711 CRT_strcpy(output->digits, "1#INF");
712 output->digitCount = 5;
713 }
714
715 return 0;
716 }
717
718 uint32_t extended_exponent = (uint32_t)binary_exponent;
719 struct CRT_LD12Fields work = {
720 .mantissa_low = value.mantissaLow,
721 .mantissa_high = value.mantissaHigh,
722 .sign_exponent = sign_exponent & CRT_EXTENDED_EXPONENT_MASK,
723 };
724 int32_t decimal_exponent =
725 (((extended_exponent >> 8) + (mantissa_high >> 0x18 << 1)) * CRT_DECIMAL_LOG10_MANTISSA_WEIGHT + extended_exponent * CRT_DECIMAL_LOG10_EXPONENT_WEIGHT - CRT_DECIMAL_LOG10_EXPONENT_OFFSET) >> 0x10;
726
727 __flt_power10(&work, -((int32_t)(int16_t)decimal_exponent), 1);
728
730 {
731 decimal_exponent += 1;
732 __flt_mul(&work, &right);
733 }
734
735 output->decimalPointPosition = (uint16_t)decimal_exponent;
736
737 int32_t effective_digit_count;
738
739 if (!((uint8_t)format_flags & CRT_DECIMAL_FIXED_PRECISION))
740 effective_digit_count = digit_count;
741 else
742 {
743 effective_digit_count = digit_count + (int32_t)(int16_t)decimal_exponent;
744
745 if (effective_digit_count <= 0)
746 {
747 output->decimalPointPosition = 0;
748 output->signCharacter = ' ';
749 output->digitCount = 1;
750 output->digits[0] = '0';
751 output->digits[1] = 0;
752
753 return 1;
754 }
755 }
756
757 if (effective_digit_count > CRT_DECIMAL_OUTPUT_DIGIT_LIMIT)
758 effective_digit_count = CRT_DECIMAL_OUTPUT_DIGIT_LIMIT;
759
760 int normalized_exponent = work.sign_exponent;
761
762 work.sign_exponent = 0;
763
764 int shift_count = 8;
765
766 do
767 {
769 } while (--shift_count);
770
771 if (normalized_exponent - (CRT_EXTENDED_EXPONENT_BIAS - 1) < 0)
772 {
773 uint32_t right_shifts_remaining = (uint32_t)(uint8_t)-(normalized_exponent - (CRT_EXTENDED_EXPONENT_BIAS - 1));
774
775 if (right_shifts_remaining > 0)
776 {
777 do
778 {
780 } while (--right_shifts_remaining);
781 }
782 }
783
784 char *digit_end = output->digits;
785 char *cursor = digit_end;
786
787 if (effective_digit_count + 1 > 0)
788 {
789 digit_count = effective_digit_count + 1;
790
791 do
792 {
793 uint32_t prior[3];
794
795 memcpy(prior, work.encoding_words, sizeof(prior));
798 ___add_12(work.encoding_words, prior);
800
801 char next_digit = *((uint8_t *)&work + 11);
802 char *digit_slot = cursor;
803
804 *((uint8_t *)&work + 11) = 0;
805 ++cursor;
806 *(uint8_t *)digit_slot = next_digit + '0';
807 } while (--digit_count);
808
809 digit_end = cursor;
810 }
811
812 char *rounding_cursor = (char *)digit_end - 2;
813
814 if (digit_end[-1] >= '5')
815 {
816 while (true)
817 {
818 if (rounding_cursor >= output->digits)
819 {
820 if (*rounding_cursor == '9')
821 {
822 *rounding_cursor = '0';
823 rounding_cursor -= 1;
824
825 continue;
826 }
827 else
828 break;
829 }
830
831 rounding_cursor = &rounding_cursor[1];
832 output->decimalPointPosition += 1;
833
834 break;
835 }
836
837 *rounding_cursor += 1;
838
839 int32_t digit_count = rounding_cursor - output->digits + 1;
840
841 output->digitCount = digit_count;
842 output->digits[digit_count] = 0;
843
844 return result;
845 }
846
847 while (true)
848 {
849 if (rounding_cursor < output->digits)
850 break;
851
852 if (*rounding_cursor != '0')
853 break;
854
855 rounding_cursor -= 1;
856 }
857
858 if (rounding_cursor >= output->digits)
859 {
860 int32_t digit_count = rounding_cursor - output->digits + 1;
861
862 output->digitCount = digit_count;
863 output->digits[digit_count] = 0;
864
865 return result;
866 }
867
868 output->decimalPointPosition = 0;
869 output->signCharacter = ' ';
870 output->digitCount = 1;
871 output->digits[0] = '0';
872 output->digits[1] = 0;
873
874 return 1;
875}
int32_t __strgtold12(struct CRT_LD12Fields *output, const char **end_pointer, char const *text, int32_t mult12, int32_t scale, int32_t decimal_point, int32_t implicit_exponent)
BOOL String_ConvertToDecimalStringFloat(struct CRT_Extended80Argument value, int32_t digit_count, uint32_t format_flags, struct CRT_DecimalFloatOutput *output)
#define CRT_EXTENDED_MANTISSA_QUIET_NAN_BIT
Definition constants.h:163
#define CRT_DECIMAL_OUTPUT_DIGIT_LIMIT
Definition constants.h:292
#define CRT_EXTENDED_MANTISSA_INTEGER_BIT
Definition constants.h:162
#define CRT_DECIMAL_LOG10_EXPONENT_OFFSET
Definition constants.h:296
CRT_DecimalParserState
Definition constants.h:82
@ CRT_DECIMAL_PARSE_LEADING_POINT
Definition constants.h:88
@ CRT_DECIMAL_PARSE_AFTER_SIGN
Definition constants.h:85
@ CRT_DECIMAL_PARSE_START
Definition constants.h:83
@ CRT_DECIMAL_PARSE_FRACTION
Definition constants.h:87
@ CRT_DECIMAL_PARSE_LEADING_ZERO
Definition constants.h:84
@ CRT_DECIMAL_PARSE_INTEGER
Definition constants.h:86
@ CRT_DECIMAL_PARSE_DONE
Definition constants.h:93
@ CRT_DECIMAL_PARSE_EXPONENT_DIGITS
Definition constants.h:92
@ CRT_DECIMAL_PARSE_EXPONENT_ZERO
Definition constants.h:91
@ CRT_DECIMAL_PARSE_IMPLICIT_EXPONENT
Definition constants.h:94
@ CRT_DECIMAL_PARSE_EXPONENT_MARKER
Definition constants.h:89
@ CRT_DECIMAL_PARSE_EXPONENT_SIGN
Definition constants.h:90
#define CRT_EXTENDED_TENTH_MANTISSA_WORD
Definition constants.h:297
#define CRT_DECIMAL_FIXED_PRECISION
Definition constants.h:67
#define CRT_DECIMAL_PARSE_DIGIT_LIMIT
Definition constants.h:291
#define CRT_DECIMAL_LOG10_EXPONENT_WEIGHT
Definition constants.h:295
#define CRT_CTYPE_DIGIT
Definition constants.h:58
#define CRT_EXTENDED_EXPONENT_BIAS
Definition constants.h:156
#define CRT_EXTENDED_TENTH_EXTRA_MANTISSA
Definition constants.h:298
#define CRT_DECIMAL_EXPONENT_LIMIT
Definition constants.h:293
#define CRT_DECIMAL_LOG10_MANTISSA_WEIGHT
Definition constants.h:294
#define CRT_EXTENDED_EXPONENT_MASK
Definition constants.h:155
#define CRT_DECIMAL_PARSE_DIGIT_CAPACITY
Definition constants.h:290
#define CRT_EXTENDED_SIGN_MASK
Definition constants.h:154
#define CRT_EXTENDED_TENTH_EXPONENT
Definition constants.h:299
CRT_DecimalParseStatus
Definition constants.h:98
@ CRT_DECIMAL_NO_MANTISSA
Definition constants.h:102
@ CRT_DECIMAL_SUCCESS
Definition constants.h:99
@ CRT_DECIMAL_UNDERFLOW
Definition constants.h:100
@ CRT_DECIMAL_OVERFLOW
Definition constants.h:101
void __shl_12byte(uint32_t *value)
void ___add_12(uint32_t *accumulator, uint32_t const *addend)
void __flt_mul(struct CRT_LD12Fields *left_and_result, struct CRT_LD12Fields const *right)
void __shr_12byte(uint32_t *value)
void __mtold12(uint8_t const *digits, uint32_t digit_count, struct CRT_LD12Fields *output)
void __flt_power10(struct CRT_LD12Fields *value, int32_t power, int32_t mult12)
int32_t CRT_isctype(int32_t ch, int32_t char_type_mask)
Definition locale.c:210
char * CRT_strcpy(char *dest, char const *src)
Definition strings.c:158
#define g_crtLcCodepage
Definition globals.h:112
uint8_t classification_flags
Definition types.h:294
char digits[0x16]
Definition types.h:13
int16_t decimalPointPosition
Definition types.h:10
uint16_t signExponent
Definition types.h:37
uint32_t mantissaHigh
Definition types.h:36
uint32_t mantissaLow
Definition types.h:35
uint16_t extra_mantissa
Definition types.h:150
uint32_t encoding_words[3]
Definition types.h:177
uint32_t mantissa_low
Definition types.h:154
uint16_t sign_exponent
Definition types.h:174
uint32_t mantissa_high
Definition types.h:165
#define g_pCharTypeTable
Definition values.h:135
#define g_decimalPointChar
Definition values.h:138