source: trunk/libs/libmath/s_copysign.c @ 662

Last change on this file since 662 was 469, checked in by alain, 6 years ago

1) Introduce the libsemaphore library.
2) Introduce a small libmath library, required by the "fft" application..
3) Introduce the multithreaded "fft" application.
4) Fix a bad synchronisation bug in the Copy-On-Write mechanism.

File size: 808 bytes
Line 
1/*
2 * ====================================================
3 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
4 *
5 * Developed at SunPro, a Sun Microsystems, Inc. business.
6 * Permission to use, copy, modify, and distribute this
7 * software is freely granted, provided that this notice
8 * is preserved.
9 * ====================================================
10 */
11
12/*
13 * Modified for ALMOS-MKH OS at UPMC, France, August 2018. (Alain Greiner)
14 */
15
16/*
17 * copysign(double x, double y)
18 * copysign(x,y) returns a value with the magnitude of x and
19 * with the sign bit of y.
20 */
21
22#include "math.h"
23#include "math_private.h"
24
25double copysign(double x, double y)
26{
27        uint32_t hx,hy;
28        GET_HIGH_WORD(hx,x);
29        GET_HIGH_WORD(hy,y);
30        SET_HIGH_WORD(x,(hx&0x7fffffff)|(hy&0x80000000));
31        return x;
32}
33
Note: See TracBrowser for help on using the repository browser.