1 | /* s_copysignl.c -- long double version of s_copysign.c. |
2 | */ |
3 | |
4 | /* |
5 | * ==================================================== |
6 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. |
7 | * |
8 | * Developed at SunPro, a Sun Microsystems, Inc. business. |
9 | * Permission to use, copy, modify, and distribute this |
10 | * software is freely granted, provided that this notice |
11 | * is preserved. |
12 | * ==================================================== |
13 | */ |
14 | |
15 | #if defined(LIBM_SCCS) && !defined(lint) |
16 | static char rcsid[] = "$NetBSD: $" ; |
17 | #endif |
18 | |
19 | /* |
20 | * copysignl(long double x, long double y) |
21 | * copysignl(x,y) returns a value with the magnitude of x and |
22 | * with the sign bit of y. |
23 | */ |
24 | |
25 | #define NO_MATH_REDIRECT |
26 | #include <math.h> |
27 | #include <math_ldbl_opt.h> |
28 | |
29 | long double __copysignl(long double x, long double y) |
30 | { |
31 | if (signbit (x) != signbit (y)) |
32 | x = -x; |
33 | return x; |
34 | } |
35 | |
36 | #if IS_IN (libm) |
37 | long_double_symbol (libm, __copysignl, copysignl); |
38 | #else |
39 | long_double_symbol (libc, __copysignl, copysignl); |
40 | #endif |
41 | |