base/math/s_copysign.c

Go to the documentation of this file.
00001 #if !defined(__ppc__) 00002 /* @(#)s_copysign.c 5.1 93/09/24 */ 00003 /* 00004 * ==================================================== 00005 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 00006 * 00007 * Developed at SunPro, a Sun Microsystems, Inc. business. 00008 * Permission to use, copy, modify, and distribute this 00009 * software is freely granted, provided that this notice 00010 * is preserved. 00011 * ==================================================== 00012 */ 00013 00014 #if defined(LIBM_SCCS) && !defined(lint) 00015 static char rcsid[] = "$NetBSD: s_copysign.c,v 1.8 1995/05/10 20:46:57 jtc Exp $"; 00016 #endif 00017 00018 /* 00019 * copysign(double x, double y) 00020 * copysign(x,y) returns a value with the magnitude of x and 00021 * with the sign bit of y. 00022 */ 00023 00024 #include "math.h" 00025 #include "mathP.h" 00026 00027 #ifdef __STDC__ 00028 double copysign(double x, double y) 00029 #else 00030 double copysign(x,y) 00031 double x,y; 00032 #endif 00033 { 00034 u_int32_t hx,hy; 00035 GET_HIGH_WORD(hx,x); 00036 GET_HIGH_WORD(hy,y); 00037 SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000)); 00038 return x; 00039 } 00040 #endif

Generated on Thu Nov 20 11:49:52 2008 for RTAI API by doxygen 1.3.8