]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/LibC/Math/s_copysign.c
ArmPkg: ArmLib: purge incorrect ArmDrainWriteBuffer () alias
[mirror_edk2.git] / StdLib / LibC / Math / s_copysign.c
CommitLineData
2aa62f2b 1/* @(#)s_copysign.c 5.1 93/09/24 */\r
2/*\r
3 * ====================================================\r
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\r
5 *\r
6 * Developed at SunPro, a Sun Microsystems, Inc. business.\r
7 * Permission to use, copy, modify, and distribute this\r
8 * software is freely granted, provided that this notice\r
9 * is preserved.\r
10 * ====================================================\r
11 */\r
12#include <LibConfig.h>\r
13#include <sys/EfiCdefs.h>\r
14#if defined(LIBM_SCCS) && !defined(lint)\r
15__RCSID("$NetBSD: s_copysign.c,v 1.11 2002/05/26 22:01:54 wiz Exp $");\r
16#endif\r
17\r
18/*\r
19 * copysign(double x, double y)\r
20 * copysign(x,y) returns a value with the magnitude of x and\r
21 * with the sign bit of y.\r
22 */\r
23\r
24#include "math.h"\r
25#include "math_private.h"\r
26\r
27double\r
28copysign(double x, double y)\r
29{\r
30 u_int32_t hx,hy;\r
31 GET_HIGH_WORD(hx,x);\r
32 GET_HIGH_WORD(hy,y);\r
33 SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000));\r
34 return x;\r
35}\r