uc-sdk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
s_ldexp.c
Go to the documentation of this file.
1 
2 /* @(#)s_ldexp.c 1.3 95/01/18 */
3 /*
4  * ====================================================
5  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6  *
7  * Developed at SunSoft, a Sun Microsystems, Inc. business.
8  * Permission to use, copy, modify, and distribute this
9  * software is freely granted, provided that this notice
10  * is preserved.
11  * ====================================================
12  */
13 
14 #include "fdlibm.h"
15 #include <errno.h>
16 
17 #ifdef __STDC__
18  double ldexp(double value, int exp)
19 #else
20  double ldexp(value, exp)
21  double value; int exp;
22 #endif
23 {
24  if(!finite(value)||value==0.0) return value;
25  value = scalbn(value,exp);
26  if(!finite(value)||value==0.0) errno = ERANGE;
27  return value;
28 }