Back to index

glibc  2.9
s_fabsl.c
Go to the documentation of this file.
00001 /* s_fabsl.c -- long double version of s_fabs.c.
00002  * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
00003  */
00004 
00005 /*
00006  * ====================================================
00007  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00008  *
00009  * Developed at SunPro, a Sun Microsystems, Inc. business.
00010  * Permission to use, copy, modify, and distribute this
00011  * software is freely granted, provided that this notice
00012  * is preserved.
00013  * ====================================================
00014  */
00015 
00016 #if defined(LIBM_SCCS) && !defined(lint)
00017 static char rcsid[] = "$NetBSD: $";
00018 #endif
00019 
00020 
00021 /*
00022  * fabsl(x) returns the absolute value of x.
00023  */
00024 
00025 #include "math.h"
00026 #include "math_private.h"
00027 #include <math_ldbl_opt.h>
00028 
00029 #ifdef __STDC__
00030        long double __fabsl(long double x)
00031 #else
00032        long double __fabsl(x)
00033        long double x;
00034 #endif
00035 {
00036        u_int64_t hx, lx;
00037        GET_LDOUBLE_WORDS64(hx,lx,x);
00038        lx = lx ^ ( hx & 0x8000000000000000LL );
00039        hx = hx & 0x7fffffffffffffffLL;
00040        SET_LDOUBLE_WORDS64(x,hx,lx);
00041        return x;
00042 }
00043 long_double_symbol (libm, __fabsl, fabsl);