Back to index

glibc  2.9
s_ldexpf.c
Go to the documentation of this file.
00001 /* s_ldexpf.c -- float version of s_ldexp.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_ldexpf.c,v 1.3 1995/05/10 20:47:42 jtc Exp $";
00018 #endif
00019 
00020 #include <math.h>
00021 #include "math_private.h"
00022 #include <errno.h>
00023 
00024 #ifdef __STDC__
00025        float __ldexpf(float value, int exp)
00026 #else
00027        float __ldexpf(value, exp)
00028        float value; int exp;
00029 #endif
00030 {
00031        if(!__finitef(value)||value==(float)0.0) return value;
00032        value = __scalbnf(value,exp);
00033        if(!__finitef(value)||value==(float)0.0) __set_errno (ERANGE);
00034        return value;
00035 }
00036 INTDEF(__ldexpf)
00037 weak_alias (__ldexpf, ldexpf)