optimized itoa function

后端 未结 8 1585
不知归路
不知归路 2021-02-04 06:48

I am thinking on how to implement the conversion of an integer (4byte, unsigned) to string with SSE instructions. The usual routine is to divide the number and store it in a loc

8条回答
  •  故里飘歌
    2021-02-04 07:06

    http://sourceforge.net/projects/itoa/

    Its uses a big static const array of all 4-digits integers and uses it for 32-bits or 64-bits conversion to string.

    Portable, no need of a specific instruction set.

    The only faster version I could find was in assembly code and limited to 32 bits.

提交回复
热议问题