SDL
2.0
s_copysign.c
Go to the documentation of this file.
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
* copysign(double x, double y)
14
* copysign(x,y) returns a value with the magnitude of x and
15
* with the sign bit of y.
16
*/
17
18
#include "
math_libm.h
"
19
#include "
math_private.h
"
20
21
double
copysign
(
double
x
,
double
y
)
22
{
23
u_int32_t
hx,hy;
24
GET_HIGH_WORD
(hx,x);
25
GET_HIGH_WORD
(hy,y);
26
SET_HIGH_WORD
(x,(hx&0x7fffffff)|(hy&0x80000000));
27
return
x
;
28
}
29
libm_hidden_def
(
copysign
)
GET_HIGH_WORD
#define GET_HIGH_WORD(i, d)
Definition:
math_private.h:108
x
GLint GLint GLint GLint GLint x
Definition:
SDL_opengl.h:1574
SET_HIGH_WORD
#define SET_HIGH_WORD(d, v)
Definition:
math_private.h:136
u_int32_t
unsigned int u_int32_t
Definition:
math_private.h:31
math_libm.h
y
GLint GLint GLint GLint GLint GLint y
Definition:
SDL_opengl.h:1574
copysign
double copysign(double x, double y)
Definition:
s_copysign.c:21
libm_hidden_def
libm_hidden_def(scalbln)
Definition:
s_scalbn.c:62
math_private.h
src
libm
s_copysign.c
Generated by
1.8.13