PR/50660: David Binderman: bad calls to printf, in test part

This commit is contained in:
christos 2016-01-16 19:44:05 +00:00
parent 10dfc2597e
commit 370ae5dba9

View File

@ -1,4 +1,4 @@
/* $NetBSD: n_fmod.c,v 1.7 2013/11/22 10:59:31 martin Exp $ */
/* $NetBSD: n_fmod.c,v 1.8 2016/01/16 19:44:05 christos Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@ -116,16 +116,26 @@ extern double fmod();
#define NCASES 3
static int nfail = 0;
static void
prf(const char *s, double d)
{
union {
double d;
unsigned long long u;
} x;
x.d = d;
printf("%s = %#016.16llx (%24.16e)\n:, s, x.u, x.d);
}
static void
doit(double x, double y)
{
double ro = fmod(x,y),rn = _fmod(x,y);
if (ro != rn) {
(void)printf(" x = 0x%08.8x %08.8x (%24.16e)\n",x,x);
(void)printf(" y = 0x%08.8x %08.8x (%24.16e)\n",y,y);
(void)printf(" fmod = 0x%08.8x %08.8x (%24.16e)\n",ro,ro);
(void)printf("_fmod = 0x%08.8x %08.8x (%24.16e)\n",rn,rn);
prf(" x ", x);
prf(" y ", y);
prf(" fmod", ro);
prf("_fmod", rn);
(void)printf("\n");
}
}