#include <corecrt_internal.h>
#include <corecrt_internal_fltintrn.h>
#include <corecrt_internal_ptd_propagation.h>
#include <fenv.h>
#include <string.h>
#include <stddef.h>
Go to the source code of this file.
|
static bool | check_trailing (char const *mantissa_it, __acrt_has_trailing_digits const trailing_digits) |
|
static bool | should_round_up (char const *const mantissa_base, char const *const mantissa_it, int const sign, __acrt_has_trailing_digits const trailing_digits, __acrt_rounding_mode const rounding_mode) |
|
errno_t __cdecl | __acrt_fp_strflt_to_string (char *const buffer, size_t const buffer_count, int digits, STRFLT const pflt, __acrt_has_trailing_digits const trailing_digits, __acrt_rounding_mode const rounding_mode, __crt_cached_ptd_host &ptd) |
|
◆ __acrt_fp_strflt_to_string()
Definition at line 104 of file _fptostr.cpp.
113{
117
120
124
125
126
127
128
129
130
131
132 *buffer_it++ = '0';
133
134
135
137 {
138 *buffer_it++ = *mantissa_it ? *mantissa_it++ : '0';
140 }
141
142 *buffer_it = '\0';
143
144
145
146
148 {
149 buffer_it--;
150
151 while (*buffer_it == '9')
152 {
153 *buffer_it-- = '0';
154 }
155
156 *buffer_it += 1;
157 }
158
160 {
161
162
164 }
165 else
166 {
167
168
170 }
171
172 return 0;
173}
static bool should_round_up(char const *const mantissa_base, char const *const mantissa_it, int const sign, __acrt_has_trailing_digits const trailing_digits, __acrt_rounding_mode const rounding_mode)
ACPI_SIZE strlen(const char *String)
#define _UCRT_VALIDATE_RETURN_ERRCODE(ptd, expr, errorcode)
result_buffer_count char *const _In_ int const _In_ bool const _In_ unsigned const _In_ STRFLT const pflt
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
_In_ size_t const _In_ int const _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const rounding_mode
static const int digits[]
#define memmove(s1, s2, n)
size_t const buffer_count
Referenced by internal_to_string().
◆ check_trailing()
Definition at line 23 of file _fptostr.cpp.
24{
26 {
27 return true;
28 }
29
30 while (*mantissa_it == '0')
31 {
32 mantissa_it++;
33 }
34
35 if (*mantissa_it != '\0')
36 {
37 return true;
38 }
39
40 return false;
41}
Referenced by should_round_up().
◆ should_round_up()
Definition at line 43 of file _fptostr.cpp.
50{
52 {
53 return *mantissa_it >= '5';
54 }
55
57
59 {
60 if (*mantissa_it > '5')
61 {
62 return true;
63 }
64
65 if (*mantissa_it < '5')
66 {
67 return false;
68 }
69
70
72 {
73 return true;
74 }
75
76
77
78
79
80
81
82 if (mantissa_it == mantissa_base)
83 {
84 return false;
85 }
86
87
88 return *(mantissa_it - 1) % 2;
89 }
90
92 {
94 }
95
97 {
99 }
100
101 return false;
102}
static bool check_trailing(char const *mantissa_it, __acrt_has_trailing_digits const trailing_digits)
int __cdecl fegetround(void)
Referenced by __acrt_fp_strflt_to_string().