this repo has no description
1/*
2 * copysignf.c
3 * cLibm
4 *
5 * Created by Ian Ollmann on 6/13/07.
6 * Copyright 2007 Apple Inc. All rights reserved.
7 *
8 */
9
10#include <math.h>
11#include <stdint.h>
12
13float copysignf( float x, float y )
14{
15 union{ float f; uint32_t u; }ux, uy;
16
17 ux.f = x;
18 uy.f = y;
19
20 ux.u &= 0x7fffffffU;
21 ux.u |= uy.u & 0x80000000U;
22
23 return ux.f;
24}