Last change
on this file since 543 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
993 bytes
|
Rev | Line | |
---|
[444] | 1 | /* wf_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 | #if __OBSOLETE_MATH |
---|
| 22 | #include <errno.h> |
---|
| 23 | #include <math.h> |
---|
| 24 | #undef log2 |
---|
| 25 | #undef log2f |
---|
| 26 | |
---|
| 27 | #ifdef __STDC__ |
---|
| 28 | float log2f(float x) /* wrapper log2f */ |
---|
| 29 | #else |
---|
| 30 | float log2f(x) /* wrapper log2f */ |
---|
| 31 | float x; |
---|
| 32 | #endif |
---|
| 33 | { |
---|
| 34 | return (logf(x) / (float_t) M_LN2); |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | #ifdef _DOUBLE_IS_32BITS |
---|
| 38 | |
---|
| 39 | #ifdef __STDC__ |
---|
| 40 | double log2(double x) |
---|
| 41 | #else |
---|
| 42 | double log2(x) |
---|
| 43 | double x; |
---|
| 44 | #endif |
---|
| 45 | { |
---|
| 46 | return (double) log2f((float) x); |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | #endif /* defined(_DOUBLE_IS_32BITS) */ |
---|
| 50 | #endif /* __OBSOLETE_MATH */ |
---|
Note: See
TracBrowser
for help on using the repository browser.