This source file includes following definitions.
- copysignl
- compute_minus_zerol
- unary_minus
- copysignl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <config.h>
18
19
20 #include <math.h>
21
22 #if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
23
24 long double
25 copysignl (long double x, long double y)
26 {
27 return copysign (x, y);
28 }
29
30 #else
31
32 # if defined __hpux && !defined __GNUC__
33
34 # include <float.h>
35
36
37 static long double
38 compute_minus_zerol (void)
39 {
40 return -LDBL_MIN * LDBL_MIN;
41 }
42 # define minus_zerol compute_minus_zerol ()
43
44
45
46 static long double
47 unary_minus (long double x)
48 {
49 if (x == 0.0L)
50 {
51 if (signbit (x))
52 return 0.0L;
53 else
54 return minus_zerol;
55 }
56 else
57 return - x;
58 }
59
60 # endif
61
62 long double
63 copysignl (long double x, long double y)
64 {
65 # if defined __hpux && !defined __GNUC__
66 return (signbit (x) != signbit (y) ? unary_minus (x) : x);
67 # else
68 return (signbit (x) != signbit (y) ? - x : x);
69 # endif
70 }
71
72 #endif