OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libm/] [common/] [sf_log2.c] - Blame information for rev 345

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* sf_log2.c -- float version of s_log2.c.
2
 * Modification of sf_exp10.c by Yaakov Selkowitz 2009.
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
/*
17
 * wrapper log2f(x)
18
 */
19
 
20
#include "fdlibm.h"
21
#include <errno.h>
22
#include <math.h>
23
#undef log2
24
#undef log2f
25
 
26
#ifdef __STDC__
27
        float log2f(float x)            /* wrapper log2f */
28
#else
29
        float log2f(x)                  /* wrapper log2f */
30
        float x;
31
#endif
32
{
33
  return (logf(x) / (float) M_LOG2_E);
34
}
35
 
36
#ifdef _DOUBLE_IS_32BITS
37
 
38
#ifdef __STDC__
39
        double log2(double x)
40
#else
41
        double log2(x)
42
        double x;
43
#endif
44
{
45
        return (double) log2f((float) x);
46
}
47
 
48
#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.