Atlas - s_copysign.c

Home / ext / SDL2 / src / libm Lines: 1 | Size: 756 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
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 21double 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} 29libm_hidden_def(copysign) 30
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.