OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libm/] [math/] [sf_ldexp.c] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1010 ivang
/* sf_ldexp.c -- float version of s_ldexp.c.
2
 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3
 */
4
 
5
/*
6
 * ====================================================
7
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8
 *
9
 * Developed at SunPro, a Sun Microsystems, Inc. business.
10
 * Permission to use, copy, modify, and distribute this
11
 * software is freely granted, provided that this notice
12
 * is preserved.
13
 * ====================================================
14
 */
15
 
16
#include "fdlibm.h"
17
#include <errno.h>
18
 
19
#ifdef __STDC__
20
        float ldexpf(float value, int exp)
21
#else
22
        float ldexpf(value, exp)
23
        float value; int exp;
24
#endif
25
{
26
        if(!finitef(value)||value==(float)0.0) return value;
27
        value = scalbnf(value,exp);
28
        if(!finitef(value)||value==(float)0.0) errno = ERANGE;
29
        return value;
30
}
31
 
32
#ifdef _DOUBLE_IS_32BITS
33
 
34
#ifdef __STDC__
35
        double ldexp(double value, int exp)
36
#else
37
        double ldexp(value, exp)
38
        double value; int exp;
39
#endif
40
{
41
        return (double) ldexpf((float) value, exp);
42
}
43
 
44
#endif /* defined(_DOUBLE_IS_32BITS) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.