12116Sjkh/* s_copysignf.c -- float version of s_copysign.c.
22116Sjkh * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
32116Sjkh */
42116Sjkh
52116Sjkh/*
62116Sjkh * ====================================================
72116Sjkh * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
82116Sjkh *
92116Sjkh * Developed at SunPro, a Sun Microsystems, Inc. business.
102116Sjkh * Permission to use, copy, modify, and distribute this
118870Srgrimes * software is freely granted, provided that this notice
122116Sjkh * is preserved.
132116Sjkh * ====================================================
142116Sjkh */
152116Sjkh
16176451Sdas#include <sys/cdefs.h>
17176451Sdas__FBSDID("$FreeBSD$");
182116Sjkh
192116Sjkh/*
202116Sjkh * copysignf(float x, float y)
212116Sjkh * copysignf(x,y) returns a value with the magnitude of x and
222116Sjkh * with the sign bit of y.
232116Sjkh */
242116Sjkh
252116Sjkh#include "math.h"
262116Sjkh#include "math_private.h"
272116Sjkh
2897413Salfredfloat
29117912Spetercopysignf(float x, float y)
302116Sjkh{
312116Sjkh	u_int32_t ix,iy;
322116Sjkh	GET_FLOAT_WORD(ix,x);
332116Sjkh	GET_FLOAT_WORD(iy,y);
342116Sjkh	SET_FLOAT_WORD(x,(ix&0x7fffffff)|(iy&0x80000000));
352116Sjkh        return x;
362116Sjkh}
37