Line | |
---|
1 | |
---|
2 | /* @(#)s_ldexp.c 5.1 93/09/24 */ |
---|
3 | /* |
---|
4 | * ==================================================== |
---|
5 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. |
---|
6 | * |
---|
7 | * Developed at SunPro, 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 <libm/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 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.