1 //Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc. 2 3 //Distributed under the Boost Software License, Version 1.0. (See accompanying 4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #ifndef BOOST_QVM_5FD6A664ACC811DEAAFF8A8055D89593 7 #define BOOST_QVM_5FD6A664ACC811DEAAFF8A8055D89593 8 9 #include <math.h> 10 #include <boost/qvm/inline.hpp> 11 12 namespace 13 boost 14 { 15 namespace 16 qvm 17 { 18 template <class T> T acos( T ); 19 template <class T> T asin( T ); 20 template <class T> T atan( T ); 21 template <class T> T atan2( T, T ); 22 template <class T> T cos( T ); 23 template <class T> T sin( T ); 24 template <class T> T tan( T ); 25 template <class T> T cosh( T ); 26 template <class T> T sinh( T ); 27 template <class T> T tanh( T ); 28 template <class T> T exp( T ); 29 template <class T> T log( T ); 30 template <class T> T log10( T ); 31 template <class T> T mod( T , T ); 32 template <class T> T pow( T, T ); 33 template <class T> T sqrt( T ); 34 template <class T> T ceil( T ); 35 template <class T> T abs( T ); 36 template <class T> T floor( T ); 37 template <class T> T mod( T, T ); 38 template <class T> T ldexp( T, int ); 39 template <class T> T sign( T ); 40 acos(float x)41 template <> BOOST_QVM_INLINE_TRIVIAL float acos<float>( float x ) { return ::acosf(x); } asin(float x)42 template <> BOOST_QVM_INLINE_TRIVIAL float asin<float>( float x ) { return ::asinf(x); } atan(float x)43 template <> BOOST_QVM_INLINE_TRIVIAL float atan<float>( float x ) { return ::atanf(x); } atan2(float x,float y)44 template <> BOOST_QVM_INLINE_TRIVIAL float atan2<float>( float x, float y ) { return ::atan2f(x,y); } cos(float x)45 template <> BOOST_QVM_INLINE_TRIVIAL float cos<float>( float x ) { return ::cosf(x); } sin(float x)46 template <> BOOST_QVM_INLINE_TRIVIAL float sin<float>( float x ) { return ::sinf(x); } tan(float x)47 template <> BOOST_QVM_INLINE_TRIVIAL float tan<float>( float x ) { return ::tanf(x); } cosh(float x)48 template <> BOOST_QVM_INLINE_TRIVIAL float cosh<float>( float x ) { return ::coshf(x); } sinh(float x)49 template <> BOOST_QVM_INLINE_TRIVIAL float sinh<float>( float x ) { return ::sinhf(x); } tanh(float x)50 template <> BOOST_QVM_INLINE_TRIVIAL float tanh<float>( float x ) { return ::tanhf(x); } exp(float x)51 template <> BOOST_QVM_INLINE_TRIVIAL float exp<float>( float x ) { return ::expf(x); } log(float x)52 template <> BOOST_QVM_INLINE_TRIVIAL float log<float>( float x ) { return ::logf(x); } log10(float x)53 template <> BOOST_QVM_INLINE_TRIVIAL float log10<float>( float x ) { return ::log10f(x); } mod(float x,float y)54 template <> BOOST_QVM_INLINE_TRIVIAL float mod<float>( float x, float y ) { return ::fmodf(x,y); } pow(float x,float y)55 template <> BOOST_QVM_INLINE_TRIVIAL float pow<float>( float x, float y ) { return ::powf(x,y); } sqrt(float x)56 template <> BOOST_QVM_INLINE_TRIVIAL float sqrt<float>( float x ) { return ::sqrtf(x); } ceil(float x)57 template <> BOOST_QVM_INLINE_TRIVIAL float ceil<float>( float x ) { return ::ceilf(x); } abs(float x)58 template <> BOOST_QVM_INLINE_TRIVIAL float abs<float>( float x ) { return ::fabsf(x); } floor(float x)59 template <> BOOST_QVM_INLINE_TRIVIAL float floor<float>( float x ) { return ::floorf(x); } ldexp(float x,int y)60 template <> BOOST_QVM_INLINE_TRIVIAL float ldexp<float>( float x, int y ) { return ::ldexpf(x,y); } sign(float x)61 template <> BOOST_QVM_INLINE_TRIVIAL float sign<float>( float x ) { return x<0 ? -1.f : +1.f; } 62 acos(double x)63 template <> BOOST_QVM_INLINE_TRIVIAL double acos<double>( double x ) { return ::acos(x); } asin(double x)64 template <> BOOST_QVM_INLINE_TRIVIAL double asin<double>( double x ) { return ::asin(x); } atan(double x)65 template <> BOOST_QVM_INLINE_TRIVIAL double atan<double>( double x ) { return ::atan(x); } atan2(double x,double y)66 template <> BOOST_QVM_INLINE_TRIVIAL double atan2<double>( double x, double y ) { return ::atan2(x,y); } cos(double x)67 template <> BOOST_QVM_INLINE_TRIVIAL double cos<double>( double x ) { return ::cos(x); } sin(double x)68 template <> BOOST_QVM_INLINE_TRIVIAL double sin<double>( double x ) { return ::sin(x); } tan(double x)69 template <> BOOST_QVM_INLINE_TRIVIAL double tan<double>( double x ) { return ::tan(x); } cosh(double x)70 template <> BOOST_QVM_INLINE_TRIVIAL double cosh<double>( double x ) { return ::cosh(x); } sinh(double x)71 template <> BOOST_QVM_INLINE_TRIVIAL double sinh<double>( double x ) { return ::sinh(x); } tanh(double x)72 template <> BOOST_QVM_INLINE_TRIVIAL double tanh<double>( double x ) { return ::tanh(x); } exp(double x)73 template <> BOOST_QVM_INLINE_TRIVIAL double exp<double>( double x ) { return ::exp(x); } log(double x)74 template <> BOOST_QVM_INLINE_TRIVIAL double log<double>( double x ) { return ::log(x); } log10(double x)75 template <> BOOST_QVM_INLINE_TRIVIAL double log10<double>( double x ) { return ::log10(x); } mod(double x,double y)76 template <> BOOST_QVM_INLINE_TRIVIAL double mod<double>( double x, double y ) { return ::fmod(x,y); } pow(double x,double y)77 template <> BOOST_QVM_INLINE_TRIVIAL double pow<double>( double x, double y ) { return ::pow(x,y); } sqrt(double x)78 template <> BOOST_QVM_INLINE_TRIVIAL double sqrt<double>( double x ) { return ::sqrt(x); } ceil(double x)79 template <> BOOST_QVM_INLINE_TRIVIAL double ceil<double>( double x ) { return ::ceil(x); } abs(double x)80 template <> BOOST_QVM_INLINE_TRIVIAL double abs<double>( double x ) { return ::fabs(x); } floor(double x)81 template <> BOOST_QVM_INLINE_TRIVIAL double floor<double>( double x ) { return ::floor(x); } ldexp(double x,int y)82 template <> BOOST_QVM_INLINE_TRIVIAL double ldexp<double>( double x, int y ) { return ::ldexp(x,y); } sign(double x)83 template <> BOOST_QVM_INLINE_TRIVIAL double sign<double>( double x ) { return x<0 ? -1.0 : +1.0; } 84 acos(long double x)85 template <> BOOST_QVM_INLINE_TRIVIAL long double acos<long double>( long double x ) { return ::acosl(x); } asin(long double x)86 template <> BOOST_QVM_INLINE_TRIVIAL long double asin<long double>( long double x ) { return ::asinl(x); } atan(long double x)87 template <> BOOST_QVM_INLINE_TRIVIAL long double atan<long double>( long double x ) { return ::atanl(x); } atan2(long double x,long double y)88 template <> BOOST_QVM_INLINE_TRIVIAL long double atan2<long double>( long double x, long double y ) { return ::atan2l(x,y); } cos(long double x)89 template <> BOOST_QVM_INLINE_TRIVIAL long double cos<long double>( long double x ) { return ::cosl(x); } sin(long double x)90 template <> BOOST_QVM_INLINE_TRIVIAL long double sin<long double>( long double x ) { return ::sinl(x); } tan(long double x)91 template <> BOOST_QVM_INLINE_TRIVIAL long double tan<long double>( long double x ) { return ::tanl(x); } cosh(long double x)92 template <> BOOST_QVM_INLINE_TRIVIAL long double cosh<long double>( long double x ) { return ::coshl(x); } sinh(long double x)93 template <> BOOST_QVM_INLINE_TRIVIAL long double sinh<long double>( long double x ) { return ::sinhl(x); } tanh(long double x)94 template <> BOOST_QVM_INLINE_TRIVIAL long double tanh<long double>( long double x ) { return ::tanhl(x); } exp(long double x)95 template <> BOOST_QVM_INLINE_TRIVIAL long double exp<long double>( long double x ) { return ::expl(x); } log(long double x)96 template <> BOOST_QVM_INLINE_TRIVIAL long double log<long double>( long double x ) { return ::logl(x); } log10(long double x)97 template <> BOOST_QVM_INLINE_TRIVIAL long double log10<long double>( long double x ) { return ::log10l(x); } mod(long double x,long double y)98 template <> BOOST_QVM_INLINE_TRIVIAL long double mod<long double>( long double x, long double y ) { return ::fmodl(x,y); } pow(long double x,long double y)99 template <> BOOST_QVM_INLINE_TRIVIAL long double pow<long double>( long double x, long double y ) { return ::powl(x,y); } sqrt(long double x)100 template <> BOOST_QVM_INLINE_TRIVIAL long double sqrt<long double>( long double x ) { return ::sqrtl(x); } ceil(long double x)101 template <> BOOST_QVM_INLINE_TRIVIAL long double ceil<long double>( long double x ) { return ::ceill(x); } abs(long double x)102 template <> BOOST_QVM_INLINE_TRIVIAL long double abs<long double>( long double x ) { return ::fabsl(x); } floor(long double x)103 template <> BOOST_QVM_INLINE_TRIVIAL long double floor<long double>( long double x ) { return ::floorl(x); } ldexp(long double x,int y)104 template <> BOOST_QVM_INLINE_TRIVIAL long double ldexp<long double>( long double x, int y ) { return ::ldexpl(x,y); } sign(long double x)105 template <> BOOST_QVM_INLINE_TRIVIAL long double sign<long double>( long double x ) { return x<0 ? -1.0 : +1.0; } 106 } 107 } 108 109 #endif 110