base/math/s_ldexp.c

Go to the documentation of this file.
00001 #if !defined(__ppc__)
00002 /* @(#)s_ldexp.c 5.1 93/09/24 */
00003 /*
00004  * ====================================================
00005  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
00006  *
00007  * Developed at SunPro, a Sun Microsystems, Inc. business.
00008  * Permission to use, copy, modify, and distribute this
00009  * software is freely granted, provided that this notice 
00010  * is preserved.
00011  * ====================================================
00012  */
00013 
00014 #if defined(LIBM_SCCS) && !defined(lint)
00015 static char rcsid[] = "$NetBSD: s_ldexp.c,v 1.6 1995/05/10 20:47:40 jtc Exp $";
00016 #endif
00017 
00018 #include "math.h"
00019 #include "mathP.h"
00020 #include <linux/errno.h>
00021 
00022 extern int libm_errno;
00023 
00024 #ifdef __STDC__
00025     double ldexp(double value, int exp)
00026 #else
00027     double ldexp(value, exp)
00028     double value; int exp;
00029 #endif
00030 {
00031     if(!finite(value)||value==0.0) return value;
00032     value = scalbn(value,exp);
00033     if(!finite(value)||value==0.0) libm_errno = ERANGE;
00034     return value;
00035 }
00036 #endif /* !__ppc__ */

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