s_copysignf.c revision 302408
1238438Sdteske/* s_copysignf.c -- float version of s_copysign.c. 2238438Sdteske * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3238438Sdteske */ 4238438Sdteske 5238438Sdteske/* 6238438Sdteske * ==================================================== 7238438Sdteske * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8238438Sdteske * 9238438Sdteske * Developed at SunPro, a Sun Microsystems, Inc. business. 10238438Sdteske * Permission to use, copy, modify, and distribute this 11238438Sdteske * software is freely granted, provided that this notice 12238438Sdteske * is preserved. 13238438Sdteske * ==================================================== 14238438Sdteske */ 15238438Sdteske 16238438Sdteske#include <sys/cdefs.h> 17238438Sdteske__FBSDID("$FreeBSD: stable/11/lib/msun/src/s_copysignf.c 176451 2008-02-22 02:30:36Z das $"); 18238438Sdteske 19238438Sdteske/* 20238438Sdteske * copysignf(float x, float y) 21238438Sdteske * copysignf(x,y) returns a value with the magnitude of x and 22238438Sdteske * with the sign bit of y. 23238438Sdteske */ 24238438Sdteske 25238438Sdteske#include "math.h" 26238438Sdteske#include "math_private.h" 27238438Sdteske 28238438Sdteskefloat 29238438Sdteskecopysignf(float x, float y) 30238438Sdteske{ 31240684Sdteske u_int32_t ix,iy; 32240684Sdteske GET_FLOAT_WORD(ix,x); 33244675Sdteske GET_FLOAT_WORD(iy,y); 34240684Sdteske SET_FLOAT_WORD(x,(ix&0x7fffffff)|(iy&0x80000000)); 35240684Sdteske return x; 36240684Sdteske} 37240684Sdteske