base/math/s_fabs.c

Go to the documentation of this file.
00001 /* @(#)s_fabs.c 5.1 93/09/24 */
00002 /*
00003  * ====================================================
00004  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00005  *
00006  * Developed at SunPro, a Sun Microsystems, Inc. business.
00007  * Permission to use, copy, modify, and distribute this
00008  * software is freely granted, provided that this notice 
00009  * is preserved.
00010  * ====================================================
00011  */
00012 
00013 #if defined(LIBM_SCCS) && !defined(lint)
00014 static char rcsid[] = "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $";
00015 #endif
00016 
00017 /*
00018  * fabs(x) returns the absolute value of x.
00019  */
00020 
00021 #include "math.h"
00022 #include "mathP.h"
00023 
00024 #ifdef __STDC__
00025     double fabs(double x)
00026 #else
00027     double fabs(x)
00028     double x;
00029 #endif
00030 {
00031     u_int32_t high;
00032     GET_HIGH_WORD(high,x);
00033     SET_HIGH_WORD(x,high&0x7fffffff);
00034         return x;
00035 }

Generated on Tue Feb 2 17:46:05 2010 for RTAI API by  doxygen 1.4.7