/* $Header:copysign.c 12.0$ */
/* $ACIS:copysign.c 12.0$ */
/* $Source: /ibm/acis/usr/src/lib/libc/ca/gen/RCS/copysign.c,v $ */

#ifndef lint
static char *rcsid = "$Header:copysign.c 12.0$";
#endif

typedef union{
     double d;
     struct {
	unsigned long hi, lo;
	} ul;
} udouble;

double copysign(x,y)			/* x copied with sign of y */
udouble x,y;
{
	x.ul.hi = (x.ul.hi & 0x7fffffff) | (y.ul.hi & 0x80000000);
	return(x.d);
}
