Itoa
World's fastest integer to ASCII conversion, C++14 template meta-programming implementation, any size integer 8,16,32,64-bit, signed or unsigned, forward (left-justified) or reverse (right justified). If you know of a faster implementation, let me know.
Install / Use
/learn @amdn/ItoaREADME
itoa
World's fastest integer to ASCII conversion, C++14 template meta-programming implementation, any size integer 8,16,32,64-bit, signed or unsigned, forward (left-justified) or reverse (right justified). If you know of a faster implementation, let me know.
Compile and link itoa.cpp with your application.
itoa.h - programming interface
itoa_impl.h - implementation
itoa.cpp - definition of digits lookup table
Two function templates are provided to print the integer (without a NUL terminator)
- left-justified, going forward at the given buffer - returns pointer to the past-the-end character of the string
- right-justified, given a pointer to the end store in reverse - returns pointer to beginning of string
// print forward, return pointer to past-the-end
template<typename I> char* itoa_fwd (I i,char *buffer);
// print reverse, return pointer to first character
template<typename I> char* itoa_rev (I i,char *buffer);
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
