/[gnats]/gnats/libiberty/copysign.c
ViewVC logotype

Diff of /gnats/libiberty/copysign.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by brendan, Thu Nov 5 19:54:15 1998 UTC revision 1.2 by chewie, Sat Nov 13 05:14:17 2004 UTC
# Line 129  typedef union Line 129  typedef union
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;  
# Line 138  double DEFUN(copysign, (x, y), double x Line 141  double DEFUN(copysign, (x, y), double x
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

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26