MCPcopy Create free account
hub / github.com/WheretIB/nullc / int__str_char___ref__

Function int__str_char___ref__

NULLC/translation/runtime.cpp:514–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514NULLCArray<char> int__str_char___ref__(int* r)
515{
516 int number = *r;
517 bool sign = 0;
518 char buf[16];
519 char *curr = buf;
520 if(number < 0)
521 sign = 1;
522
523 *curr++ = (char)(abs(number % 10) + '0');
524 while(number /= 10)
525 *curr++ = (char)(abs(number % 10) + '0');
526 if(sign)
527 *curr++ = '-';
528 NULLCArray<char> arr = __newA(1, (int)(curr - buf) + 1, 0);
529 char *str = arr.ptr;
530 do
531 {
532 --curr;
533 *str++ = *curr;
534 }while(curr != buf);
535 return arr;
536}
537NULLCArray<char> double__str_char___ref_int_(int precision, int* r)
538{
539 char buf[256];

Callers

nothing calls this directly

Calls 2

__newAFunction · 0.85
absFunction · 0.70

Tested by

no test coverage detected