spandsp 0.0.6
|
00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * floating_fudge.h - A bunch of shims, to use double maths 00005 * functions on platforms which lack the 00006 * float versions with an 'f' at the end, 00007 * and to deal with the vaguaries of lrint(). 00008 * 00009 * Written by Steve Underwood <steveu@coppice.org> 00010 * 00011 * Copyright (C) 2008 Steve Underwood 00012 * 00013 * All rights reserved. 00014 * 00015 * This program is free software; you can redistribute it and/or modify 00016 * it under the terms of the GNU Lesser General Public License version 2.1, 00017 * as published by the Free Software Foundation. 00018 * 00019 * This program is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 * GNU Lesser General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU Lesser General Public 00025 * License along with this program; if not, write to the Free Software 00026 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00027 * 00028 * $Id: floating_fudge.h,v 1.7 2009/02/03 16:28:39 steveu Exp $ 00029 */ 00030 00031 #if !defined(_FLOATING_FUDGE_H_) 00032 #define _FLOATING_FUDGE_H_ 00033 00034 #if defined(__cplusplus) 00035 extern "C" 00036 { 00037 #endif 00038 00039 #if !defined(HAVE_SINF) 00040 static __inline__ float sinf(float x) 00041 { 00042 return (float) sin((double) x); 00043 } 00044 #endif 00045 00046 #if !defined(HAVE_COSF) 00047 static __inline__ float cosf(float x) 00048 { 00049 return (float) cos((double) x); 00050 } 00051 #endif 00052 00053 #if !defined(HAVE_TANF) 00054 static __inline__ float tanf(float x) 00055 { 00056 return (float) tan((double) x); 00057 } 00058 #endif 00059 00060 #if !defined(HAVE_ASINF) 00061 static __inline__ float asinf(float x) 00062 { 00063 return (float) asin((double) x); 00064 } 00065 #endif 00066 00067 #if !defined(HAVE_ACOSF) 00068 static __inline__ float acosf(float x) 00069 { 00070 return (float) acos((double) x); 00071 } 00072 #endif 00073 00074 #if !defined(HAVE_ATANF) 00075 static __inline__ float atanf(float x) 00076 { 00077 return (float) atan((double) x); 00078 } 00079 00080 #endif 00081 00082 #if !defined(HAVE_ATAN2F) 00083 static __inline__ float atan2f(float y, float x) 00084 { 00085 return (float) atan2((double) y, (double) x); 00086 } 00087 00088 #endif 00089 00090 #if !defined(HAVE_CEILF) 00091 static __inline__ float ceilf(float x) 00092 { 00093 return (float) ceil((double) x); 00094 } 00095 #endif 00096 00097 #if !defined(HAVE_FLOORF) 00098 static __inline__ float floorf(float x) 00099 { 00100 return (float) floor((double) x); 00101 } 00102 00103 #endif 00104 00105 #if !defined(HAVE_POWF) 00106 static __inline__ float powf(float x, float y) 00107 { 00108 return (float) pow((double) x, (double) y); 00109 } 00110 #endif 00111 00112 #if !defined(HAVE_EXPF) 00113 static __inline__ float expf(float x) 00114 { 00115 return (float) expf((double) x); 00116 } 00117 #endif 00118 00119 #if !defined(HAVE_LOGF) 00120 static __inline__ float logf(float x) 00121 { 00122 return (float) logf((double) x); 00123 } 00124 #endif 00125 00126 #if !defined(HAVE_LOG10F) 00127 static __inline__ float log10f(float x) 00128 { 00129 return (float) log10((double) x); 00130 } 00131 #endif 00132 00133 #if defined(__cplusplus) 00134 } 00135 #endif 00136 00137 #endif 00138 00139 /*- End of file ------------------------------------------------------------*/