master
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#include <math.h>
7
8typedef union U
9{
10 unsigned int u[2];
11 double d;
12} U;
13
14double copysign(double x, double y)
15{
16 U h,j;
17 h.d = x;
18 j.d = y;
19 h.u[1] = (h.u[1] & 0x7fffffff) | (j.u[1] & 0x80000000);
20 return h.d;
21}