93 char* output_ptr = &output[0];
101 if (
value == INFINITY) {
104 if (
value == -INFINITY) {
112 return static_cast<unsigned>(output_ptr - output);
121 (void)std::frexp(
value, &binaryExponent);
122 static const double kLog2 = 0.3010299956639812;
123 int decimalExponent =
static_cast<int>(std::floor(kLog2 * binaryExponent));
124 int decimalShift = decimalExponent - 8;
125 double power =
pow10(-decimalShift);
127 int d =
static_cast<int>(
value * power + 0.5);
132 decimalShift = decimalExponent - 7;
135 d =
static_cast<int>(
value * (power * 0.1) + 0.5);
138 while (
d % 10 == 0) {
147 buffer[bufferIndex++] =
d % 10;
151 if (decimalShift >= 0) {
154 *output_ptr++ =
'0' +
buffer[bufferIndex];
155 }
while (bufferIndex);
156 for (
int i = 0; i < decimalShift; ++i) {
160 int placesBeforeDecimal = bufferIndex + decimalShift;
161 if (placesBeforeDecimal > 0) {
162 while (placesBeforeDecimal-- > 0) {
164 *output_ptr++ =
'0' +
buffer[bufferIndex];
169 int placesAfterDecimal = -placesBeforeDecimal;
170 while (placesAfterDecimal-- > 0) {
174 while (bufferIndex > 0) {
176 *output_ptr++ =
'0' +
buffer[bufferIndex];
177 if (output_ptr ==
end) {
186 return static_cast<unsigned>(output_ptr - output);
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
static const uint8_t buffer[]