Blame sysdeps/ieee754/ldbl-96/s_copysignl.c

Packit 6c4009
/* s_copysignl.c -- long double version of s_copysign.c.
Packit 6c4009
 * Conversion to long double by Ulrich Drepper,
Packit 6c4009
 * Cygnus Support, drepper@cygnus.com.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * ====================================================
Packit 6c4009
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
Packit 6c4009
 *
Packit 6c4009
 * Developed at SunPro, a Sun Microsystems, Inc. business.
Packit 6c4009
 * Permission to use, copy, modify, and distribute this
Packit 6c4009
 * software is freely granted, provided that this notice
Packit 6c4009
 * is preserved.
Packit 6c4009
 * ====================================================
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#if defined(LIBM_SCCS) && !defined(lint)
Packit 6c4009
static char rcsid[] = "$NetBSD: $";
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * copysignl(long double x, long double y)
Packit 6c4009
 * copysignl(x,y) returns a value with the magnitude of x and
Packit 6c4009
 * with the sign bit of y.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#include <math.h>
Packit 6c4009
#include <math_private.h>
Packit 6c4009
#include <libm-alias-ldouble.h>
Packit 6c4009
Packit 6c4009
long double __copysignl(long double x, long double y)
Packit 6c4009
{
Packit 6c4009
	uint32_t es1,es2;
Packit 6c4009
	GET_LDOUBLE_EXP(es1,x);
Packit 6c4009
	GET_LDOUBLE_EXP(es2,y);
Packit 6c4009
	SET_LDOUBLE_EXP(x,(es1&0x7fff)|(es2&0x8000));
Packit 6c4009
        return x;
Packit 6c4009
}
Packit 6c4009
libm_alias_ldouble (__copysign, copysign)