Blame sysdeps/ieee754/ldbl-128/s_copysignl.c
|
Packit Service |
82fcde |
/* s_copysignl.c -- long double version of s_copysign.c.
|
|
Packit Service |
82fcde |
* Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/*
|
|
Packit Service |
82fcde |
* ====================================================
|
|
Packit Service |
82fcde |
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
Packit Service |
82fcde |
*
|
|
Packit Service |
82fcde |
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
Packit Service |
82fcde |
* Permission to use, copy, modify, and distribute this
|
|
Packit Service |
82fcde |
* software is freely granted, provided that this notice
|
|
Packit Service |
82fcde |
* is preserved.
|
|
Packit Service |
82fcde |
* ====================================================
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
|
|
Packit Service |
1c5418 |
#if defined(LIBM_SCCS) && !defined(lint)
|
|
Packit Service |
82fcde |
static char rcsid[] = "$NetBSD: $";
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/*
|
|
Packit Service |
82fcde |
* copysignl(long double x, long double y)
|
|
Packit Service |
82fcde |
* copysignl(x,y) returns a value with the magnitude of x and
|
|
Packit Service |
82fcde |
* with the sign bit of y.
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include <math.h>
|
|
Packit Service |
82fcde |
#include <math_private.h>
|
|
Packit Service |
82fcde |
#include <libm-alias-ldouble.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
1c5418 |
_Float128 __copysignl(_Float128 x, _Float128 y)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
1c5418 |
uint64_t hx,hy;
|
|
Packit Service |
1c5418 |
GET_LDOUBLE_MSW64(hx,x);
|
|
Packit Service |
1c5418 |
GET_LDOUBLE_MSW64(hy,y);
|
|
Packit Service |
1c5418 |
SET_LDOUBLE_MSW64(x,(hx&0x7fffffffffffffffULL)
|
|
Packit Service |
1c5418 |
|(hy&0x8000000000000000ULL));
|
|
Packit Service |
1c5418 |
return x;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
libm_alias_ldouble (__copysign, copysign)
|