Blame sysdeps/ieee754/flt-32/s_copysignf.c

Packit 6c4009
/* s_copysignf.c -- float version of s_copysign.c.
Packit 6c4009
 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@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 Service c82647
#if defined(LIBM_SCCS) && !defined(lint)
Packit 6c4009
static char rcsid[] = "$NetBSD: s_copysignf.c,v 1.4 1995/05/10 20:46:59 jtc Exp $";
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * copysignf(float x, float y)
Packit 6c4009
 * copysignf(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 Service c82647
#include <math_private.h>
Packit 6c4009
#include <libm-alias-float.h>
Packit 6c4009
Packit Service c82647
float __copysignf(float x, float y)
Packit 6c4009
{
Packit Service c82647
	uint32_t ix,iy;
Packit Service c82647
	GET_FLOAT_WORD(ix,x);
Packit Service c82647
	GET_FLOAT_WORD(iy,y);
Packit Service c82647
	SET_FLOAT_WORD(x,(ix&0x7fffffff)|(iy&0x80000000));
Packit Service c82647
        return x;
Packit 6c4009
}
Packit 6c4009
libm_alias_float (__copysign, copysign)