Back to index

glibc  2.9
s_fabsf.c
Go to the documentation of this file.
00001 /* s_fabsf.c -- float version of s_fabs.c.
00002  * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
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: s_fabsf.c,v 1.4 1995/05/10 20:47:15 jtc Exp $";
00018 #endif
00019 
00020 /*
00021  * fabsf(x) returns the absolute value of x.
00022  */
00023 
00024 #include "math.h"
00025 #include "math_private.h"
00026 
00027 #ifdef __STDC__
00028        float __fabsf(float x)
00029 #else
00030        float __fabsf(x)
00031        float x;
00032 #endif
00033 {
00034        u_int32_t ix;
00035        GET_FLOAT_WORD(ix,x);
00036        SET_FLOAT_WORD(x,ix&0x7fffffff);
00037         return x;
00038 }
00039 weak_alias (__fabsf, fabsf)