40 void test10(
long long max)
44 printf(
"testing mul10str() function: (%lld) values\n", max);
45 for(val=0;val<max;++val)
50 printf(
"%lld * 10 = %lld, != %lld\n", val, (val * 10), s);
52 printf(
"Done %lld tests\n\n", val);
57 int main(
int argc,
char *argv[])
69 printf(
"sizeof(long) = %d\n", (
int)
sizeof(
long));
70 printf(
"sizeof(long long) = %d\n", (
int)
sizeof(
long long));
71 printf(
"sizeof(val) = %d\n", (
int)
sizeof(val));
72 printf(
"sizeof(__uint128_t) = %d\n", (
int)
sizeof(__uint128_t));
73 printf(
"sizeof( intmax_t ) == %d\n", (
int)
sizeof( intmax_t ));
78 printf(
"Enter a number or ENTER to quit:");
90 val2 = strto128(line,
NULL, 10);
91 if(val2 < (__int128_t) 0)
96 size =
bin2num(numresult, 1022, 1, 10, (
uint8_t *) &val2,
sizeof(val2), sign_ch);
98 printf(
"numresult[%s]\n",numresult);
MEMSPACE size_t WEAK_ATR strlen(const char *str)
String Length.
MEMSPACE int mul10str(uint8_t *str, int size)
Fast multiply number of any size by 10.
MEMSPACE char * fgets(char *str, int size, FILE *stream)
get a string from stdin See fdevopen() sets stream->put get for TTY devices
MEMSPACE int bin2num(uint8_t *str, int strmax, int nummin, int base, uint8_t *nump, int numsize, int sign_ch)
Convert an unsigned number (numsize bytes in size) to ASCII in specified base Notes: No limit except ...
int main(int argc, char *argv[])
Math IO functions, and verious conversion code with floating point support.
#define stdin
define stdin, stdout and stderr
MEMSPACE int printf(const char *format,...)