| 160 | } |
| 161 | |
| 162 | int utoa64(u64 value, char *sp, int radix) { |
| 163 | char tmp[32]; // larger buffer for 64-bit values |
| 164 | char *tp = tmp; |
| 165 | int i; |
| 166 | u64 v = value; |
| 167 | |
| 168 | while (v || tp == tmp) { |
| 169 | i = v % radix; |
| 170 | v = radix ? v / radix : 0; |
| 171 | if (i < 10) |
| 172 | *tp++ = i + '0'; |
| 173 | else |
| 174 | *tp++ = i + 'a' - 10; |
| 175 | } |
| 176 | |
| 177 | int len = tp - tmp; |
| 178 | |
| 179 | while (tp > tmp) |
| 180 | *sp++ = *--tp; |
| 181 | |
| 182 | *sp = '\0'; // Null-terminate the string |
| 183 | return len; |
| 184 | } |
| 185 | |
| 186 | void ftoa(float value, char *buffer, int precision) { |
| 187 | // Forward to printf_detail for now - implementation in str.cpp will be updated |
no outgoing calls
no test coverage detected