MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / adddigit

Function adddigit

extlibs/lua/src/lstrlib.c:1013–1018  ·  view source on GitHub ↗

** Add integer part of 'x' to buffer and return new 'x' */

Source from the content-addressed store, hash-verified

1011** Add integer part of 'x' to buffer and return new 'x'
1012*/
1013static lua_Number adddigit (char *buff, int n, lua_Number x) {
1014 lua_Number dd = l_mathop(floor)(x); /* get integer part from 'x' */
1015 int d = (int)dd;
1016 buff[n] = (d < 10 ? d + '0' : d - 10 + 'a'); /* add to buffer */
1017 return x - dd; /* return what is left */
1018}
1019
1020
1021static int num2straux (char *buff, int sz, lua_Number x) {

Callers 1

num2strauxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected