123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- #include <math.h>
- #define RAD_TO_DEG 57.2957795130823208767981548141052
- #define DEG_TO_RAD 0.0174532925199432957692369076848861
- #ifndef __STDC_VERSION__
- #define __STDC_VERSION__ 0
- #endif
- #if __STDC_VERSION__ >= 199901L
- inline int bbIsNan( double x ){
- return isnan(x) ? 1 : 0;
- }
- inline int bbIsInf( double x ){
- return isinf(x) ? 1 : 0;
- }
- inline double bbSqr( double x ){
- return sqrt( x );
- }
- inline double bbSin( double x ){
- return sin( x*DEG_TO_RAD );
- }
- inline double bbCos( double x ){
- return cos( x*DEG_TO_RAD );
- }
- inline double bbTan( double x ){
- return tan( x*DEG_TO_RAD );
- }
- inline double bbASin( double x ){
- return asin( x ) * RAD_TO_DEG;
- }
- inline double bbACos( double x ){
- return acos( x ) * RAD_TO_DEG;
- }
- inline double bbATan( double x ){
- return atan( x ) * RAD_TO_DEG;
- }
- inline double bbATan2( double y,double x ){
- return atan2( y,x ) * RAD_TO_DEG;
- }
- inline double bbSinh( double x ){
- return sinh( x );
- }
- inline double bbCosh( double x ){
- return cosh( x );
- }
- inline double bbTanh( double x ){
- return tanh( x );
- }
- inline double bbExp( double x ){
- return exp( x );
- }
- inline double bbFloor( double x ){
- return floor( x );
- }
- inline double bbLog( double x ){
- return log(x);
- }
- inline double bbLog10( double x ){
- return log10(x);
- }
- inline double bbCeil( double x ){
- return ceil( x );
- }
- inline double bbRound( double x ){
- return round( x );
- }
- inline double bbTrunc( double x ){
- return trunc( x );
- }
- inline double bbDeg2Rad( double x ){
- return x * DEG_TO_RAD;
- }
- inline double bbRad2Deg( double x ){
- return x * RAD_TO_DEG;
- }
- #define RAD_TO_DEGF 57.2957795
- #define DEG_TO_RADF 0.0174532
- inline float bbSqrf( float x ){
- return sqrtf( x );
- }
- inline float bbSinf( float x ){
- return sinf( x*DEG_TO_RADF );
- }
- inline float bbCosf( float x ){
- return cosf( x*DEG_TO_RADF );
- }
- inline float bbTanf( float x ){
- return tanf( x*DEG_TO_RADF );
- }
- inline float bbASinf( float x ){
- return asinf( x ) * RAD_TO_DEGF;
- }
- inline float bbACosf( float x ){
- return acosf( x ) * RAD_TO_DEGF;
- }
- inline float bbATanf( float x ){
- return atanf( x ) * RAD_TO_DEGF;
- }
- inline float bbATan2f( float y,float x ){
- return atan2f( y,x ) * RAD_TO_DEGF;
- }
- inline float bbSinhf( float x ){
- return sinhf( x );
- }
- inline float bbCoshf( float x ){
- return coshf( x );
- }
- inline float bbTanhf( float x ){
- return tanhf( x );
- }
- inline float bbExpf( float x ){
- return expf( x );
- }
- inline float bbFloorf( float x ){
- return floorf( x );
- }
- inline float bbLogf( float x ){
- return logf(x);
- }
- inline float bbLog10f( float x ){
- return log10f(x);
- }
- inline float bbCeilf( float x ){
- return ceilf( x );
- }
- inline float bbRoundf( float x ){
- return roundf( x );
- }
- inline float bbTruncf( float x ){
- return truncf( x );
- }
- inline float bbDeg2Radf( float x ){
- return x * DEG_TO_RADF;
- }
- inline float bbRad2Degf( float x ){
- return x * RAD_TO_DEGF;
- }
- #else
- int bbIsNan( double x );
- int bbIsInf( double x );
- double bbSqr( double x );
- double bbSin( double x );
- double bbCos( double x );
- double bbTan( double x );
- double bbASin( double x );
- double bbACos( double x );
- double bbATan( double x );
- double bbATan2( double y,double x );
- double bbSinh( double x );
- double bbCosh( double x );
- double bbTanh( double x );
- double bbExp( double x );
- double bbFloor( double x );
- double bbLog( double x );
- double bbLog10( double x );
- double bbCeil( double x );
- double bbRound( double x );
- double bbTrunc( double x );
- double bbDeg2Rad( double x );
- double bbRad2Deg( double x );
- int bbIsNanf( float x );
- int bbIsInff( float x );
- float bbSqrf( float x );
- float bbSinf( float x );
- float bbCosf( float x );
- float bbTanf( float x );
- float bbASinf( float x );
- float bbACosf( float x );
- float bbATanf( float x );
- float bbATan2f( float y,float x );
- float bbSinhf( float x );
- float bbCoshf( float x );
- float bbTanhf( float x );
- float bbExpf( float x );
- float bbFloorf( float x );
- float bbLogf( float x );
- float bbLog10f( float x );
- float bbCeilf( float x );
- float bbRoundf( float x );
- float bbTruncf( float x );
- float bbDeg2Radf( float x );
- float bbRad2Degf( float x );
- #endif
|