Back to index

glibc  2.9
s_copysignl.c
Go to the documentation of this file.
00001 /* s_copysignl.c -- long double version of s_copysign.c.
00002  * Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
00003  */
00004 
00005 /*
00006  * ====================================================
00007  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00008  *
00009  * Developed at SunPro, a Sun Microsystems, Inc. business.
00010  * Permission to use, copy, modify, and distribute this
00011  * software is freely granted, provided that this notice
00012  * is preserved.
00013  * ====================================================
00014  */
00015 
00016 #if defined(LIBM_SCCS) && !defined(lint)
00017 static char rcsid[] = "$NetBSD: $";
00018 #endif
00019 
00020 /*
00021  * copysignl(long double x, long double y)
00022  * copysignl(x,y) returns a value with the magnitude of x and
00023  * with the sign bit of y.
00024  */
00025 
00026 #include "math.h"
00027 #include "math_private.h"
00028 #include <math_ldbl_opt.h>
00029 
00030 #ifdef __STDC__
00031        long double __copysignl(long double x, long double y)
00032 #else
00033        long double __copysignl(x,y)
00034        long double x,y;
00035 #endif
00036 {
00037   if (signbit (x) != signbit (y))
00038     x = -x;
00039   return x;
00040 }
00041 
00042 #ifdef IS_IN_libm
00043 long_double_symbol (libm, __copysignl, copysignl);
00044 #else
00045 long_double_symbol (libc, __copysignl, copysignl);
00046 #endif