| 1072 | } |
| 1073 | |
| 1074 | char* FastUInt128ToBufferLeft(unsigned __int128 i, char* buffer) { |
| 1075 | static const unsigned __int128 TWENTY_DIGITS = |
| 1076 | static_cast<unsigned __int128>(10000000000) |
| 1077 | * static_cast<unsigned __int128>(10000000000); |
| 1078 | |
| 1079 | uint64 u = static_cast<uint64>(i); |
| 1080 | if (u == i) return FastUInt64ToBufferLeft(u, buffer); |
| 1081 | |
| 1082 | unsigned __int128 top_19_digits = i / TWENTY_DIGITS; |
| 1083 | buffer = FastUInt64ToBufferLeft(top_19_digits, buffer); |
| 1084 | unsigned __int128 rem128 = i - (top_19_digits * TWENTY_DIGITS); |
| 1085 | |
| 1086 | unsigned __int128 middle_19_digits = rem128 / 10; |
| 1087 | buffer = FastUInt64ToBufferLeft(middle_19_digits, buffer); |
| 1088 | u = rem128 - (middle_19_digits * 10); |
| 1089 | |
| 1090 | buffer = FastUInt32ToBufferLeft(u, buffer); |
| 1091 | |
| 1092 | return buffer; |
| 1093 | } |
| 1094 | |
| 1095 | char* FastInt128ToBufferLeft(__int128 i, char* buffer) { |
| 1096 | unsigned __int128 u = i; |
no test coverage detected