int main(void) { d_type *dptr; for (dptr = strtods; dptr->line; dptr++) { fprintf(stdout, "strtod32(\"%s\",NULL) == %Hf\n ", dptr->input, strtod32(dptr->input, NULL)); _VC_P(__FILE__,dptr->line,dptr->d32,strtod32(dptr->input,NULL), "%Hf"); fprintf(stdout, "strtod64(\"%s\",NULL) == %Df\n ", dptr->input, strtod64(dptr->input, NULL)); _VC_P(__FILE__,dptr->line,dptr->d64, strtod64(dptr->input,NULL), "%Df"); fprintf(stdout, "strtod128(\"%s\",NULL) == %DDf\n ", dptr->input, strtod128(dptr->input, NULL)); _VC_P(__FILE__,dptr->line,dptr->d128, strtod128(dptr->input,NULL), "%DDf"); } d_nan_type *dnanptr; for (dnanptr = strtods_nan; dnanptr->line; dnanptr++) { _DC_P(__FILE__,dnanptr->line,dnanptr->d32,strtod32(dnanptr->input,NULL)); _DC_P(__FILE__,dnanptr->line,dnanptr->d64, strtod64(dnanptr->input,NULL)); _DC_P(__FILE__,dnanptr->line,dnanptr->d128, strtod128(dnanptr->input,NULL)); } _REPORT(); /* fail comes from scaffold.c */ return fail; }
int main (void) { int i; for (i=0; i<d128s; ++i) { _DC_P (__FILE__, d128[i].line, d128[i].expect, d128[i].d); } for (i=0; i<d64s; ++i) { _DC_P (__FILE__, d64[i].line, d64[i].expect, d64[i].d); } for (i=0; i<d32s; ++i) { _DC_P (__FILE__, d32[i].line, d32[i].expect, d32[i].d); } _REPORT (); /* fail comes from scaffold.c */ return fail; }
int main (void) { #define DECIMAL_PRINTF_BUF_SIZE 65 /* ((DECIMAL128_PMAX + 14) * 2) + 1 */ char digits[DECIMAL_PRINTF_BUF_SIZE]; int exp; /* the exponent */ int is_neg; /* is negative */ int is_nan; /* is not a number */ int is_inf; /* is infinite */ int i; for (i=0; i<d32_s; ++i) { fprintf (stdout, "__get_digits_d32(%HeDF) in: %s:%d\n", d32[i].d, __FILE__, __LINE__ - 1); memset (&digits[0], '\0', DECIMAL_PRINTF_BUF_SIZE); __get_digits_d32 (d32[i].d, digits + 1, &exp, &is_neg, &is_nan, &is_inf); out_digits (digits, is_neg, exp); _SC_P (__FILE__, d32[i].line, d32[i].expect, &digits[0]); } for (i=0; i<d64_s; ++i) { fprintf (stdout, "__get_digits_d64(%DeDD) in: %s:%d\n", d64[i].d, __FILE__, __LINE__ - 1); __get_digits_d64 (d64[i].d, digits + 1, &exp, &is_neg, &is_nan, &is_inf); out_digits (digits, is_neg, exp); _SC_P (__FILE__, d64[i].line, d64[i].expect, &digits[0]); } for (i=0; i<d128_s; ++i) { fprintf (stdout, "__get_digits_d128(%DDeDL) in: %s:%d\n", d128[i].d, __FILE__, __LINE__ - 1); __get_digits_d128 (d128[i].d, digits + 1, &exp, &is_neg, &is_nan, &is_inf); out_digits (digits, is_neg, exp); _SC_P (__FILE__, d128[i].line, d128[i].expect, &digits[0]); } _REPORT (); /* fail comes from scaffold.c */ return fail; }