|
HP85 GPIB Disk Emulator
1.0
HP85GPIBDiskEmulator
|
Go to the documentation of this file.
38 void test10(
long long max)
42 printf(
"testing mul10str() function: (%lld) values\n", max);
43 for(val=0;val<max;++val)
48 printf(
"%lld * 10 = %lld, != %lld\n", val, (val * 10), s);
50 printf(
"Done %lld tests\n\n", val);
54 int main(
int argc,
char *argv[])
65 printf(
"sizeof(long) = %d\n", (
int)
sizeof(
long));
66 printf(
"sizeof(long long) = %d\n", (
int)
sizeof(
long long));
67 printf(
"sizeof(val) = %d\n", (
int)
sizeof(val));
68 printf(
"sizeof(__uint128_t) = %d\n", (
int)
sizeof(__uint128_t));
69 printf(
"sizeof( intmax_t ) == %d\n", (
int)
sizeof( intmax_t ));
75 printf(
"Enter a number or ENTER to quit:");
87 val2 = strto128(line,
NULL, 10);
88 if(val2 < (__int128_t) 0)
93 size =
bin2num(numresult, 1022, 1, 10, (uint8_t *) &val2,
sizeof(val2), sign_ch);
95 printf(
"numresult[%s]\n",numresult);
MEMSPACE int printf(const char *format,...)
#define stdin
define stdin, stdout and stderr
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 mul10str(uint8_t *str, int size)
Fast multiply number of any size by 10.
MEMSPACE size_t WEAK_ATR strlen(const char *str)
String Length.
int main(void)
main() for gpib project
Math IO functions, and verious conversion code with floating point support.
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 ...