Lines Matching +full:- +full:v

37 /* soft floats on m68k have rounding bugs for 64-bit values */
52 double v; in test_strtod() local
55 v = strtod(pd->string, &tail); in test_strtod()
56 if (tail - pd->string) { in test_strtod()
57 if (fabs(v) < DBL_MIN && !(pd->endscan & ENDSCAN_IS_ZERO)) { in test_strtod()
60 if (strncasecmp(pd->string, "0x", 2) == 0) in test_strtod()
65 } else if (isinf(v) && !(pd->endscan & ENDSCAN_IS_INF)) in test_strtod()
70 test_mok(v, pd->value, CONVERT_BITS_DOUBLE); in test_strtod()
71 test_iok(tail - pd->string, pd->endscan & ENDSCAN_MASK); in test_strtod()
78 float v; in test_strtof() local
81 v = strtof(pd->string, &tail); in test_strtof()
82 if (tail - pd->string) { in test_strtof()
84 if (fabsf(v) < FLT_MIN && !(pd->endscan & ENDSCAN_IS_ZERO)) in test_strtof()
86 else if (isinf(v) && !(pd->endscan & ENDSCAN_IS_INF)) in test_strtof()
91 test_mfok((double) v, pd->value, CONVERT_BITS_FLOAT); in test_strtof()
92 test_iok(tail - pd->string, pd->endscan & ENDSCAN_MASK); in test_strtof()
110 long double v, av; in test_strtold() local
113 v = strtold(pd->string, &tail); in test_strtold()
114 if (tail - pd->string) { in test_strtold()
116 av = v; in test_strtold()
118 av = -av; in test_strtold()
119 if (av < LDBL_MIN && !(pd->endscan & ENDSCAN_IS_ZERO)) in test_strtold()
121 else if (isinf(av) && !(pd->endscan & ENDSCAN_IS_INF)) in test_strtold()
126 test_mok(v, pd->value, STRTOLD_TEST_BITS); in test_strtold()
127 test_iok(tail - pd->string, pd->endscan & ENDSCAN_MASK); in test_strtold()
134 test_mok(atof(pd->string), pd->value, CONVERT_BITS_DOUBLE); in test_atof()
141 float v = atoff(pd->string); in test_atoff() local
142 test_mfok(v, (float) pd->value, CONVERT_BITS_FLOAT); in test_atoff()
153 if (!pd->string) in iterate()
157 while (pd->string) { in iterate()
158 line(pd->line); in iterate()
175 if (!p->string) in int_iterate()
180 while (p->string) { in int_iterate()
181 line(p->line); in int_iterate()
197 test_iok(r, pi->value); in test_strtol_base()
198 test_eok(errno, pi->errno_val); in test_strtol_base()
199 test_iok(ptr - string, pi->end); in test_strtol_base()
205 test_strtol_base(8,&(p->octal), p->string); in test_strtol()
206 test_strtol_base(10,&(p->decimal), p->string); in test_strtol()
207 test_strtol_base(16, &(p->hex), p->string); in test_strtol()
208 test_strtol_base(0, &(p->normal), p->string); in test_strtol()
209 test_strtol_base(26, &(p->alphabetical), p->string); in test_strtol()
215 if (p->decimal.errno_val == 0) in test_atoi()
216 test_iok(atoi(p->string), p->decimal.value); in test_atoi()
222 test_iok(atol(p->string), p->decimal.value); in test_atol()
223 test_eok(errno, p->decimal.errno_val); in test_atol()
237 #define ecvt_r(n, dig, dec, sign, buf, len) (ecvtbuf(n, dig, dec, sign, buf) ? 0 : -1)
238 #define fcvt_r(n, dig, dec, sign, buf, len) (fcvtbuf(n, dig, dec, sign, buf) ? 0 : -1)
239 #define ecvtf_r(n, dig, dec, sign, buf, len) (ecvtbuf(n, dig, dec, sign, buf) ? 0 : -1)
240 #define fcvtf_r(n, dig, dec, sign, buf, len) (fcvtbuf(n, dig, dec, sign, buf) ? 0 : -1)
250 r = ecvt_r(pdd->value, pdd->e1, &a2, &a3, buffer, sizeof(buffer)); in test_ecvt_r()
253 test_sok(buffer,pdd->estring); in test_ecvt_r()
254 test_iok(pdd->e2,a2); in test_ecvt_r()
255 test_iok(pdd->e3,a3); in test_ecvt_r()
258 r = ecvtf_r(pdd->value, pdd->e1, &a2, &a3, buffer, sizeof(buffer)); in test_ecvt_r()
261 test_scok(buffer,pdd->estring, 6); in test_ecvt_r()
262 test_iok(pdd->e2,a2); in test_ecvt_r()
263 test_iok(pdd->e3,a3); in test_ecvt_r()
272 s = check_null(ecvt(pdd->value, pdd->e1, &a2, &a3)); in test_ecvt()
274 test_sok(s,pdd->estring); in test_ecvt()
275 test_iok(pdd->e2,a2); in test_ecvt()
276 test_iok(pdd->e3,a3); in test_ecvt()
279 s = check_null(ecvtf(pdd->value, pdd->e1, &a2, &a3)); in test_ecvt()
281 test_scok(s,pdd->estring, 6); in test_ecvt()
282 test_iok(pdd->e2,a2); in test_ecvt()
283 test_iok(pdd->e3,a3); in test_ecvt()
292 r = fcvt_r(pdd->value, pdd->f1, &a2, &a3, buffer, sizeof(buffer)); in test_fcvt_r()
295 test_scok(buffer,pdd->fstring,10); in test_fcvt_r()
296 test_iok(pdd->f2,a2); in test_fcvt_r()
297 test_iok(pdd->f3,a3); in test_fcvt_r()
306 r = fcvtf_r(pdd->value, pdd->f1, &a2, &a3, fbuffer, sizeof(fbuffer)); in test_fcvt_r()
312 int x = strlen(buffer) - strlen(fbuffer); in test_fcvt_r()
313 while (x-- > 0) in test_fcvt_r()
316 test_iok(0, sde - buffer); in test_fcvt_r()
320 test_iok(0, sfe - fbuffer); in test_fcvt_r()
324 test_iok(pdd->f2,a2); in test_fcvt_r()
325 test_iok(pdd->f3,a3); in test_fcvt_r()
332 char *s = check_null(gcvt(pdd->value, pdd->g1, buffer)); in test_gcvt()
333 test_scok(s, pdd->gstring, 9); in test_gcvt()
336 s = check_null(gcvtf(pdd->value, pdd->g1, buffer)); in test_gcvt()
337 test_scok2(s, pdd->gstring, pdd->gfstring, 6); in test_gcvt()
346 sd = check_null(fcvt(pdd->value, pdd->f1, &a2, &a3)); in test_fcvt()
348 test_scok(sd,pdd->fstring,10); in test_fcvt()
349 test_iok(pdd->f2,a2); in test_fcvt()
350 test_iok(pdd->f3,a3); in test_fcvt()
359 sf = check_null(fcvtf(pdd->value, pdd->f1, &a2, &a3)); in test_fcvt()
364 int x = strlen(sd) - strlen(sf); in test_fcvt()
365 while (x-- > 0) in test_fcvt()
368 test_iok(0, sde - sd); in test_fcvt()
372 test_iok(0, sfe - sf); in test_fcvt()
376 test_iok(pdd->f2,a2); in test_fcvt()
377 test_iok(pdd->f3,a3); in test_fcvt()
386 if (!pdd->estring) in diterate()
391 while (pdd->estring) { in diterate()
392 line(pdd->line); in diterate()
399 #if TEST_PART ==1 || TEST_PART == -1
412 sprintf(buffer,"%.2g", 1.2e-6); in deltest()
413 test_sok(buffer,"1.2e-06"); in deltest()
449 while (s->line) in test_sprint()
451 line( s->line); in test_sprint()
452 sprintf(buffer, s->format_string, s->value); in test_sprint()
454 if (s->mag) in test_sprint()
456 s->value, buffer, s->format_string, s->mag); in test_sprint()
459 s->value, buffer, s->format_string); in test_sprint()
461 test_scok(buffer, s->result, 12); /* Only check the first 12 digs, in test_sprint()
472 while (si->line) in test_sprint()
474 line( si->line); in test_sprint()
475 if (strchr(si->format_string, 'l')) in test_sprint()
476 sprintf(buffer, si->format_string, (long) si->value); in test_sprint()
478 sprintf(buffer, si->format_string, si->value); in test_sprint()
482 char *df = si->format_string; in test_sprint()
503 sprintf(sbuffer, sformat, (short) si->value); in test_sprint()
510 printf("#if TEST_PART == %d || TEST_PART == -1\n", q); in test_sprint()
513 if (si->value < 0) in test_sprint()
514 printf("{__LINE__, -%#09xl, %s, \"%s\", },\n", in test_sprint()
515 -si->value, sformat, si->format_string); in test_sprint()
518 si->value, sformat, si->format_string); in test_sprint()
525 test_sok(buffer, si->result); in test_sprint()
549 while (s->line) in test_scan()
553 line( s->line); in test_scan()
554 sscanf(s->result, "%lg", &d0); in test_scan()
557 if (s->mag && s->mag < CONVERT_BITS_DOUBLE) in test_scan()
558 test_mok(d0, d1, s->mag); in test_scan()
566 while (si->line) in test_scan()
571 line(si->line); in test_scan()
572 sscanf(si->result, "%ld", &d0); in test_scan()
604 strcpy(ebuf, check_null(ecvt(pdd->value, pdd->e1, &e_decpt, &e_sign))); in gen_dvec()
605 strcpy(fbuf, check_null(fcvt(pdd->value, pdd->f1, &f_decpt, &f_sign))); in gen_dvec()
606 check_null(gcvt(pdd->value, pdd->g1, gbuf)); in gen_dvec()
608 pdd->value, in gen_dvec()
609 ebuf, pdd->e1, e_decpt, e_sign, in gen_dvec()
610 fbuf, pdd->f1, f_decpt, f_sign, in gen_dvec()
611 gbuf, pdd->g1); in gen_dvec()
644 #if TEST_PART ==1 || TEST_PART == -1 in test_cvt()