/* * Program to find out the storage space need to transfer a number over TDS */ #include #include #include using namespace std; int main (int argc, char *argv[]) { unsigned tbprecision[17]; tbprecision[0] = 0; for (int i=1; i<=16; i++){ union { __uint128_t v; unsigned char tb[16]; }u; memset (u.tb,0,sizeof(u.tb)); for (int j=0; j0; i--){ if (tbprecision[i] < precision){ break; }else{ storage = i; } } if (column == 0) printf ("\t"); printf ("%u,",storage+1); // We add 1 for the sign byte column++; if (column == 5){ printf ("\n"); column = 0; } } printf ("};\n"); return 0; }