129 |
} __ieee_float_shape_type; |
} __ieee_float_shape_type; |
130 |
#endif |
#endif |
131 |
|
|
132 |
|
#if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN) |
133 |
|
|
134 |
double DEFUN(copysign, (x, y), double x AND double y) |
double |
135 |
|
copysign (x, y) |
136 |
|
double x, y; |
137 |
{ |
{ |
138 |
__ieee_double_shape_type a,b; |
__ieee_double_shape_type a,b; |
139 |
b.value = y; |
b.value = y; |
141 |
a.number.sign =b.number.sign; |
a.number.sign =b.number.sign; |
142 |
return a.value; |
return a.value; |
143 |
} |
} |
144 |
|
|
145 |
|
#else |
146 |
|
|
147 |
|
double |
148 |
|
copysign (x, y) |
149 |
|
double x, y; |
150 |
|
{ |
151 |
|
if ((x < 0 && y > 0) || (x > 0 && y < 0)) |
152 |
|
return -x; |
153 |
|
return x; |
154 |
|
} |
155 |
|
|
156 |
|
#endif |