Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/math

    rdab7ac7 r53a6c2a  
    1010// Created On       : Mon Apr 18 23:37:04 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 20 21:45:07 2017
    13 // Update Count     : 77
     12// Last Modified On : Fri Jul  7 09:34:15 2017
     13// Update Count     : 61
    1414//
    1515
    1616#pragma once
    1717
    18 #include <math.h>
    19 #include <complex.h>
    20 
    21 static inline float ?%?( float x, float y ) { return fmodf( x, y ); }
    22 static inline float fmod( float x, float y ) { return fmodf( x, y ); }
    23 static inline double ?%?( double x, double y ) { return fmod( x, y ); }
     18extern "C" {
     19#include <math.h>                                                                               // fpclassify, isfinite, isnormal, isnan, isinf
     20} // extern "C"
     21
     22float ?%?( float, float );
     23float fmod( float, float );
     24double ?%?( double, double );
    2425// extern "C" { double fmod( double, double ); }
    25 static inline long double ?%?( long double x, long double y ) { return fmodl( x, y ); }
    26 static inline long double fmod( long double x, long double y ) { return fmodl( x, y ); }
    27 
    28 static inline float remainder( float x, float y ) { return remainderf( x, y ); }
     26long double ?%?( long double, long double );
     27long double fmod( long double, long double );
     28
     29float remainder( float, float );
    2930// extern "C" { double remainder( double, double ); }
    30 static inline long double remainder( long double x, long double y ) { return remainderl( x, y ); }
    31 
    32 static inline float remquo( float x, float y, int * quo ) { return remquof( x, y, quo ); }
    33 // extern "C" { double remquo( double x, double y, int * quo ); }
    34 static inline long double remquo( long double x, long double y, int * quo ) { return remquol( x, y, quo ); }
    35 static inline [ int, float ] remquo( float x, float y ) { int quo; x = remquof( x, y, &quo ); return [ quo, x ]; }
    36 static inline [ int, double ] remquo( double x, double y ) { int quo; x = remquo( x, y, &quo ); return [ quo, x ]; }
    37 static inline [ int, long double ] remquo( long double x, long double y ) { int quo; x = remquol( x, y, &quo ); return [ quo, x ]; }
    38 
    39 // alternative name for remquo
    40 static inline float div( float x, float y, int * quo ) { return remquof( x, y, quo ); }
    41 static inline double div( double x, double y, int * quo ) { return remquo( x, y, quo ); }
    42 static inline long double div( long double x, long double y, int * quo ) { return remquol( x, y, quo ); }
    43 static inline [ int, float ] div( float x, float y ) { int quo; x = remquof( x, y, &quo ); return [ quo, x ]; }
    44 static inline [ int, double ] div( double x, double y ) { int quo; x = remquo( x, y, &quo ); return [ quo, x ]; }
    45 static inline [ int, long double ] div( long double x, long double y ) { int quo; x = remquol( x, y, &quo ); return [ quo, x ]; }
    46 
    47 static inline float fma( float x, float y, float z ) { return fmaf( x, y, z ); }
     31long double remainder( long double, long double );
     32
     33[ int, float ] remquo( float, float );
     34float remquo( float, float, int * );
     35[ int, double ] remquo( double, double );
     36// extern "C" { double remquo( double, double, int * ); }
     37[ int, long double ] remquo( long double, long double );
     38long double remquo( long double, long double, int * );
     39
     40[ int, float ] div( float, float );                                             // alternative name for remquo
     41float div( float, float, int * );
     42[ int, double ] div( double, double );
     43// extern "C" { double div( double, double, int * ); }
     44[ int, long double ] div( long double, long double );
     45long double div( long double, long double, int * );
     46
     47float fma( float, float, float );
    4848// extern "C" { double fma( double, double, double ); }
    49 static inline long double fma( long double x, long double y, long double z ) { return fmal( x, y, z ); }
    50 
    51 static inline float fdim( float x, float y ) { return fdimf( x, y ); }
     49long double fma( long double, long double, long double );
     50
     51float fdim( float, float );
    5252// extern "C" { double fdim( double, double ); }
    53 static inline long double fdim( long double x, long double y ) { return fdiml( x, y ); }
    54 
    55 static inline float nan( const char * tag ) { return nanf( tag ); }
     53long double fdim( long double, long double );
     54
     55float nan( const char * );
    5656// extern "C" { double nan( const char * ); }
    57 static inline long double nan( const char * tag ) { return nanl( tag ); }
     57long double nan( const char * );
    5858
    5959//---------------------- Exponential ----------------------
    6060
    61 static inline float exp( float x ) { return expf( x ); }
     61float exp( float );
    6262// extern "C" { double exp( double ); }
    63 static inline long double exp( long double x ) { return expl( x ); }
    64 static inline float _Complex exp( float _Complex x ) { return cexpf( x ); }
    65 static inline double _Complex exp( double _Complex x ) { return cexp( x ); }
    66 static inline long double _Complex exp( long double _Complex x ) { return cexpl( x ); }
    67 
    68 static inline float exp2( float x ) { return exp2f( x ); }
     63long double exp( long double );
     64float _Complex exp( float _Complex );
     65double _Complex exp( double _Complex );
     66long double _Complex exp( long double _Complex );
     67
     68float exp2( float );
    6969// extern "C" { double exp2( double ); }
    70 static inline long double exp2( long double x ) { return exp2l( x ); }
    71 //static inline float _Complex exp2( float _Complex x ) { return cexp2f( x ); }
    72 //static inline double _Complex exp2( double _Complex x ) { return cexp2( x ); }
    73 //static inline long double _Complex exp2( long double _Complex x ) { return cexp2l( x ); }
    74 
    75 static inline float expm1( float x ) { return expm1f( x ); }
     70long double exp2( long double );
     71// float _Complex exp2( float _Complex );
     72// double _Complex exp2( double _Complex );
     73// long double _Complex exp2( long double _Complex );
     74
     75float expm1( float );
    7676// extern "C" { double expm1( double ); }
    77 static inline long double expm1( long double x ) { return expm1l( x ); }
    78 
    79 static inline float pow( float x, float y ) { return powf( x, y ); }
     77long double expm1( long double );
     78
     79float log( float );
     80// extern "C" { double log( double ); }
     81long double log( long double );
     82float _Complex log( float _Complex );
     83double _Complex log( double _Complex );
     84long double _Complex log( long double _Complex );
     85
     86float log2( float );
     87// extern "C" { double log2( double ); }
     88long double log2( long double );
     89// float _Complex log2( float _Complex );
     90// double _Complex log2( double _Complex );
     91// long double _Complex log2( long double _Complex );
     92
     93float log10( float );
     94// extern "C" { double log10( double ); }
     95long double log10( long double );
     96// float _Complex log10( float _Complex );
     97// double _Complex log10( double _Complex );
     98// long double _Complex log10( long double _Complex );
     99
     100float log1p( float );
     101// extern "C" { double log1p( double ); }
     102long double log1p( long double );
     103
     104int ilogb( float );
     105// extern "C" { int ilogb( double ); }
     106int ilogb( long double );
     107
     108float logb( float );
     109// extern "C" { double logb( double ); }
     110long double logb( long double );
     111
     112//---------------------- Power ----------------------
     113
     114float sqrt( float );
     115// extern "C" { double sqrt( double ); }
     116long double sqrt( long double );
     117float _Complex sqrt( float _Complex );
     118double _Complex sqrt( double _Complex );
     119long double _Complex sqrt( long double _Complex );
     120
     121float cbrt( float );
     122// extern "C" { double cbrt( double ); }
     123long double cbrt( long double );
     124
     125float hypot( float, float );
     126// extern "C" { double hypot( double, double ); }
     127long double hypot( long double, long double );
     128
     129float pow( float, float );
    80130// extern "C" { double pow( double, double ); }
    81 static inline long double pow( long double x, long double y ) { return powl( x, y ); }
    82 static inline float _Complex pow( float _Complex x, float _Complex y ) { return cpowf( x, y ); }
    83 static inline double _Complex pow( double _Complex x, double _Complex y ) { return cpow( x, y ); }
    84 static inline long double _Complex pow( long double _Complex x, long double _Complex y ) { return cpowl( x, y ); }
    85 
    86 static inline float ?\?( float x, float y ) { return powf( x, y ); }
    87 static inline double ?\?( double x, double y ) { return pow( x, y ); }
    88 static inline long double ?\?( long double x, long double y ) { return powl( x, y ); }
    89 static inline float _Complex ?\?( float _Complex x, _Complex float y ) { return cpowf(x, y ); }
    90 static inline double _Complex ?\?( double _Complex x, _Complex double y ) { return cpow( x, y ); }
    91 static inline long double _Complex ?\?( long double _Complex x, _Complex long double y ) { return cpowl( x, y ); }
    92 
    93 static inline float ?\=?( float * x, float y ) { *x = *x \ y; return *x; }
    94 static inline double ?\=?( double * x, double y ) { *x = *x \ y; return *x; }
    95 static inline long double ?\=?( long double * x, long double y ) { *x = *x \ y; return *x; }
    96 static inline float _Complex ?\=?( float _Complex * x, _Complex float y ) { *x = *x \ y; return *x; }
    97 static inline double _Complex ?\=?( double _Complex * x, _Complex double y ) { *x = *x \ y; return *x; }
    98 static inline long double _Complex ?\=?( long double _Complex * x, _Complex long double y ) { *x = *x \ y; return *x; }
    99 
    100 static inline long int ?\?( long int x, unsigned long y ) {     // disallow negative exponent
    101     if ( y == 0 ) return 1;
    102     if ( x == 2 ) return x << (y - 1);
    103     long int prod = 1;
    104     for ( unsigned int i = 0; i < y; i += 1 ) {
    105                 prod = prod * x;
    106     } // for
    107     return prod;
    108 }
    109 static inline double ?\?( long int x, signed long y ) { // allow negative exponent
    110     if ( y >=  0 ) return (double)(x \ (unsigned int)y);
    111     else return 1.0 / x \ (unsigned int)(-y);
    112 }
    113 static inline forall( otype T | { void ?{}( T * this, one_t ); T ?*?( T, T ); } )
    114 T ?\?( T x, unsigned long y ) {
    115     T prod = 1;
    116     for ( unsigned int i = 1; i < y; i += 1 ) {
    117                 prod = prod * x;
    118     } // for
    119     return prod;
    120 }
    121 static inline long int ?\=?( long int * x, unsigned long y ) { *x = *x \ y; return *x; }
    122 static inline int ?\=?( int * x, unsigned long y ) { *x = *x \ y; return *x; }
    123 
    124 //---------------------- Logarithm ----------------------
    125 
    126 static inline float log( float x ) { return logf( x ); }
    127 // extern "C" { double log( double ); }
    128 static inline long double log( long double x ) { return logl( x ); }
    129 static inline float _Complex log( float _Complex x ) { return clogf( x ); }
    130 static inline double _Complex log( double _Complex x ) { return clog( x ); }
    131 static inline long double _Complex log( long double _Complex x ) { return clogl( x ); }
    132 
    133 static inline float log2( float x ) { return log2f( x ); }
    134 // extern "C" { double log2( double ); }
    135 static inline long double log2( long double x ) { return log2l( x ); }
    136 // static inline float _Complex log2( float _Complex x ) { return clog2f( x ); }
    137 // static inline double _Complex log2( double _Complex x ) { return clog2( x ); }
    138 // static inline long double _Complex log2( long double _Complex x ) { return clog2l( x ); }
    139 
    140 static inline float log10( float x ) { return log10f( x ); }
    141 // extern "C" { double log10( double ); }
    142 static inline long double log10( long double x ) { return log10l( x ); }
    143 // static inline float _Complex log10( float _Complex x ) { return clog10f( x ); }
    144 // static inline double _Complex log10( double _Complex x ) { return clog10( x ); }
    145 // static inline long double _Complex log10( long double _Complex x ) { return clog10l( x ); }
    146 
    147 static inline float log1p( float x ) { return log1pf( x ); }
    148 // extern "C" { double log1p( double ); }
    149 static inline long double log1p( long double x ) { return log1pl( x ); }
    150 
    151 static inline int ilogb( float x ) { return ilogbf( x ); }
    152 // extern "C" { int ilogb( double ); }
    153 static inline int ilogb( long double x ) { return ilogbl( x ); }
    154 
    155 static inline float logb( float x ) { return logbf( x ); }
    156 // extern "C" { double logb( double ); }
    157 static inline long double logb( long double x ) { return logbl( x ); }
    158 
    159 static inline float sqrt( float x ) { return sqrtf( x ); }
    160 // extern "C" { double sqrt( double ); }
    161 static inline long double sqrt( long double x ) { return sqrtl( x ); }
    162 static inline float _Complex sqrt( float _Complex x ) { return csqrtf( x ); }
    163 static inline double _Complex sqrt( double _Complex x ) { return csqrt( x ); }
    164 static inline long double _Complex sqrt( long double _Complex x ) { return csqrtl( x ); }
    165 
    166 static inline float cbrt( float x ) { return cbrtf( x ); }
    167 // extern "C" { double cbrt( double ); }
    168 static inline long double cbrt( long double x ) { return cbrtl( x ); }
    169 
    170 static inline float hypot( float x, float y ) { return hypotf( x, y ); }
    171 // extern "C" { double hypot( double, double ); }
    172 static inline long double hypot( long double x, long double y ) { return hypotl( x, y ); }
     131long double pow( long double, long double );
     132float _Complex pow( float _Complex, float _Complex );
     133double _Complex pow( double _Complex, double _Complex );
     134long double _Complex pow( long double _Complex, long double _Complex );
    173135
    174136//---------------------- Trigonometric ----------------------
    175137
    176 static inline float sin( float x ) { return sinf( x ); }
     138float sin( float );
    177139// extern "C" { double sin( double ); }
    178 static inline long double sin( long double x ) { return sinl( x ); }
    179 static inline float _Complex sin( float _Complex x ) { return csinf( x ); }
    180 static inline double _Complex sin( double _Complex x ) { return csin( x ); }
    181 static inline long double _Complex sin( long double _Complex x ) { return csinl( x ); }
    182 
    183 static inline float cos( float x ) { return cosf( x ); }
     140long double sin( long double );
     141float _Complex sin( float _Complex );
     142double _Complex sin( double _Complex );
     143long double _Complex sin( long double _Complex );
     144
     145float cos( float );
    184146// extern "C" { double cos( double ); }
    185 static inline long double cos( long double x ) { return cosl( x ); }
    186 static inline float _Complex cos( float _Complex x ) { return ccosf( x ); }
    187 static inline double _Complex cos( double _Complex x ) { return ccos( x ); }
    188 static inline long double _Complex cos( long double _Complex x ) { return ccosl( x ); }
    189 
    190 static inline float tan( float x ) { return tanf( x ); }
     147long double cos( long double );
     148float _Complex cos( float _Complex );
     149double _Complex cos( double _Complex );
     150long double _Complex cos( long double _Complex );
     151
     152float tan( float );
    191153// extern "C" { double tan( double ); }
    192 static inline long double tan( long double x ) { return tanl( x ); }
    193 static inline float _Complex tan( float _Complex x ) { return ctanf( x ); }
    194 static inline double _Complex tan( double _Complex x ) { return ctan( x ); }
    195 static inline long double _Complex tan( long double _Complex x ) { return ctanl( x ); }
    196 
    197 static inline float asin( float x ) { return asinf( x ); }
     154long double tan( long double );
     155float _Complex tan( float _Complex );
     156double _Complex tan( double _Complex );
     157long double _Complex tan( long double _Complex );
     158
     159float asin( float );
    198160// extern "C" { double asin( double ); }
    199 static inline long double asin( long double x ) { return asinl( x ); }
    200 static inline float _Complex asin( float _Complex x ) { return casinf( x ); }
    201 static inline double _Complex asin( double _Complex x ) { return casin( x ); }
    202 static inline long double _Complex asin( long double _Complex x ) { return casinl( x ); }
    203 
    204 static inline float acos( float x ) { return acosf( x ); }
     161long double asin( long double );
     162float _Complex asin( float _Complex );
     163double _Complex asin( double _Complex );
     164long double _Complex asin( long double _Complex );
     165
     166float acos( float );
    205167// extern "C" { double acos( double ); }
    206 static inline long double acos( long double x ) { return acosl( x ); }
    207 static inline float _Complex acos( float _Complex x ) { return cacosf( x ); }
    208 static inline double _Complex acos( double _Complex x ) { return cacos( x ); }
    209 static inline long double _Complex acos( long double _Complex x ) { return cacosl( x ); }
    210 
    211 static inline float atan( float x ) { return atanf( x ); }
     168long double acos( long double );
     169float _Complex acos( float _Complex );
     170double _Complex acos( double _Complex );
     171long double _Complex acos( long double _Complex );
     172
     173float atan( float );
    212174// extern "C" { double atan( double ); }
    213 static inline long double atan( long double x ) { return atanl( x ); }
    214 static inline float _Complex atan( float _Complex x ) { return catanf( x ); }
    215 static inline double _Complex atan( double _Complex x ) { return catan( x ); }
    216 static inline long double _Complex atan( long double _Complex x ) { return catanl( x ); }
    217 
    218 static inline float atan2( float x, float y ) { return atan2f( x, y ); }
     175long double atan( long double );
     176float _Complex atan( float _Complex );
     177double _Complex atan( double _Complex );
     178long double _Complex atan( long double _Complex );
     179
     180float atan2( float, float );
    219181// extern "C" { double atan2( double, double ); }
    220 static inline long double atan2( long double x, long double y ) { return atan2l( x, y ); }
    221 
    222 // alternative name for atan2
    223 static inline float atan( float x, float y ) { return atan2f( x, y ); }
    224 static inline double atan( double x, double y ) { return atan2( x, y ); }
    225 static inline long double atan( long double x, long double y ) { return atan2l( x, y ); }
     182long double atan2( long double, long double );
     183
     184float atan( float, float );                                                             // alternative name for atan2
     185double atan( double, double );
     186long double atan( long double, long double );
    226187
    227188//---------------------- Hyperbolic ----------------------
    228189
    229 static inline float sinh( float x ) { return sinhf( x ); }
     190float sinh( float );
    230191// extern "C" { double sinh( double ); }
    231 static inline long double sinh( long double x ) { return sinhl( x ); }
    232 static inline float _Complex sinh( float _Complex x ) { return csinhf( x ); }
    233 static inline double _Complex sinh( double _Complex x ) { return csinh( x ); }
    234 static inline long double _Complex sinh( long double _Complex x ) { return csinhl( x ); }
    235 
    236 static inline float cosh( float x ) { return coshf( x ); }
     192long double sinh( long double );
     193float _Complex sinh( float _Complex );
     194double _Complex sinh( double _Complex );
     195long double _Complex sinh( long double _Complex );
     196
     197float cosh( float );
    237198// extern "C" { double cosh( double ); }
    238 static inline long double cosh( long double x ) { return coshl( x ); }
    239 static inline float _Complex cosh( float _Complex x ) { return ccoshf( x ); }
    240 static inline double _Complex cosh( double _Complex x ) { return ccosh( x ); }
    241 static inline long double _Complex cosh( long double _Complex x ) { return ccoshl( x ); }
    242 
    243 static inline float tanh( float x ) { return tanhf( x ); }
     199long double cosh( long double );
     200float _Complex cosh( float _Complex );
     201double _Complex cosh( double _Complex );
     202long double _Complex cosh( long double _Complex );
     203
     204float tanh( float );
    244205// extern "C" { double tanh( double ); }
    245 static inline long double tanh( long double x ) { return tanhl( x ); }
    246 static inline float _Complex tanh( float _Complex x ) { return ctanhf( x ); }
    247 static inline double _Complex tanh( double _Complex x ) { return ctanh( x ); }
    248 static inline long double _Complex tanh( long double _Complex x ) { return ctanhl( x ); }
    249 
    250 static inline float asinh( float x ) { return asinhf( x ); }
     206long double tanh( long double );
     207float _Complex tanh( float _Complex );
     208double _Complex tanh( double _Complex );
     209long double _Complex tanh( long double _Complex );
     210
     211float asinh( float );
    251212// extern "C" { double asinh( double ); }
    252 static inline long double asinh( long double x ) { return asinhl( x ); }
    253 static inline float _Complex asinh( float _Complex x ) { return casinhf( x ); }
    254 static inline double _Complex asinh( double _Complex x ) { return casinh( x ); }
    255 static inline long double _Complex asinh( long double _Complex x ) { return casinhl( x ); }
    256 
    257 static inline float acosh( float x ) { return acoshf( x ); }
     213long double asinh( long double );
     214float _Complex asinh( float _Complex );
     215double _Complex asinh( double _Complex );
     216long double _Complex asinh( long double _Complex );
     217
     218float acosh( float );
    258219// extern "C" { double acosh( double ); }
    259 static inline long double acosh( long double x ) { return acoshl( x ); }
    260 static inline float _Complex acosh( float _Complex x ) { return cacoshf( x ); }
    261 static inline double _Complex acosh( double _Complex x ) { return cacosh( x ); }
    262 static inline long double _Complex acosh( long double _Complex x ) { return cacoshl( x ); }
    263 
    264 static inline float atanh( float x ) { return atanhf( x ); }
     220long double acosh( long double );
     221float _Complex acosh( float _Complex );
     222double _Complex acosh( double _Complex );
     223long double _Complex acosh( long double _Complex );
     224
     225float atanh( float );
    265226// extern "C" { double atanh( double ); }
    266 static inline long double atanh( long double x ) { return atanhl( x ); }
    267 static inline float _Complex atanh( float _Complex x ) { return catanhf( x ); }
    268 static inline double _Complex atanh( double _Complex x ) { return catanh( x ); }
    269 static inline long double _Complex atanh( long double _Complex x ) { return catanhl( x ); }
     227long double atanh( long double );
     228float _Complex atanh( float _Complex );
     229double _Complex atanh( double _Complex );
     230long double _Complex atanh( long double _Complex );
    270231
    271232//---------------------- Error / Gamma ----------------------
    272233
    273 static inline float erf( float x ) { return erff( x ); }
     234float erf( float );
    274235// extern "C" { double erf( double ); }
    275 static inline long double erf( long double x ) { return erfl( x ); }
     236long double erf( long double );
    276237// float _Complex erf( float _Complex );
    277238// double _Complex erf( double _Complex );
    278239// long double _Complex erf( long double _Complex );
    279240
    280 static inline float erfc( float x ) { return erfcf( x ); }
     241float erfc( float );
    281242// extern "C" { double erfc( double ); }
    282 static inline long double erfc( long double x ) { return erfcl( x ); }
     243long double erfc( long double );
    283244// float _Complex erfc( float _Complex );
    284245// double _Complex erfc( double _Complex );
    285246// long double _Complex erfc( long double _Complex );
    286247
    287 static inline float lgamma( float x ) { return lgammaf( x ); }
     248float lgamma( float );
    288249// extern "C" { double lgamma( double ); }
    289 static inline long double lgamma( long double x ) { return lgammal( x ); }
    290 static inline float lgamma( float x, int * sign ) { return lgammaf_r( x, sign ); }
    291 static inline double lgamma( double x, int * sign ) { return lgamma_r( x, sign ); }
    292 static inline long double lgamma( long double x, int * sign ) { return lgammal_r( x, sign ); }
    293 
    294 static inline float tgamma( float x ) { return tgammaf( x ); }
     250long double lgamma( long double );
     251float lgamma( float, int * );
     252double lgamma( double, int * );
     253long double lgamma( long double, int * );
     254
     255float tgamma( float );
    295256// extern "C" { double tgamma( double ); }
    296 static inline long double tgamma( long double x ) { return tgammal( x ); }
     257long double tgamma( long double );
    297258
    298259//---------------------- Nearest Integer ----------------------
    299260
    300 static inline float floor( float x ) { return floorf( x ); }
     261float floor( float );
    301262// extern "C" { double floor( double ); }
    302 static inline long double floor( long double x ) { return floorl( x ); }
    303 
    304 static inline float ceil( float x ) { return ceilf( x ); }
     263long double floor( long double );
     264
     265float ceil( float );
    305266// extern "C" { double ceil( double ); }
    306 static inline long double ceil( long double x ) { return ceill( x ); }
    307 
    308 static inline float trunc( float x ) { return truncf( x ); }
     267long double ceil( long double );
     268
     269float trunc( float );
    309270// extern "C" { double trunc( double ); }
    310 static inline long double trunc( long double x ) { return truncl( x ); }
    311 
    312 static inline float rint( float x ) { return rintf( x ); }
    313 // extern "C" { double rint( double x ); }
    314 static inline long double rint( long double x ) { return rintl( x ); }
    315 static inline long int rint( float x ) { return lrintf( x ); }
    316 static inline long int rint( double x ) { return lrint( x ); }
    317 static inline long int rint( long double x ) { return lrintl( x ); }
    318 static inline long long int rint( float x ) { return llrintf( x ); }
    319 static inline long long int rint( double x ) { return llrint( x ); }
    320 static inline long long int rint( long double x ) { return llrintl( x ); }
    321 
    322 static inline long int lrint( float x ) { return lrintf( x ); }
     271long double trunc( long double );
     272
     273float rint( float );
     274long double rint( long double );
     275long int rint( float );
     276long int rint( double );
     277long int rint( long double );
     278long long int rint( float );
     279long long int rint( double );
     280long long int rint( long double );
     281
     282long int lrint( float );
    323283// extern "C" { long int lrint( double ); }
    324 static inline long int lrint( long double x ) { return lrintl( x ); }
    325 static inline long long int llrint( float x ) { return llrintf( x ); }
     284long int lrint( long double );
     285long long int llrint( float );
    326286// extern "C" { long long int llrint( double ); }
    327 static inline long long int llrint( long double x ) { return llrintl( x ); }
    328 
    329 static inline float nearbyint( float x ) { return nearbyintf( x ); }
     287long long int llrint( long double );
     288
     289float nearbyint( float );
    330290// extern "C" { double nearbyint( double ); }
    331 static inline long double nearbyint( long double x ) { return nearbyintl( x ); }
    332 
    333 static inline float round( float x ) { return roundf( x ); }
    334 // extern "C" { double round( double x ); }
    335 static inline long double round( long double x ) { return roundl( x ); }
    336 static inline long int round( float x ) { return lroundf( x ); }
    337 static inline long int round( double x ) { return lround( x ); }
    338 static inline long int round( long double x ) { return lroundl( x ); }
    339 static inline long long int round( float x ) { return llroundf( x ); }
    340 static inline long long int round( double x ) { return llround( x ); }
    341 static inline long long int round( long double x ) { return llroundl( x ); }
    342 
    343 static inline long int lround( float x ) { return lroundf( x ); }
     291long double nearbyint( long double );
     292
     293float round( float );
     294long double round( long double );
     295long int round( float );
     296long int round( double );
     297long int round( long double );
     298long long int round( float );
     299long long int round( double );
     300long long int round( long double );
     301
     302long int lround( float );
    344303// extern "C" { long int lround( double ); }
    345 static inline long int lround( long double x ) { return lroundl( x ); }
    346 static inline long long int llround( float x ) { return llroundf( x ); }
     304long int lround( long double );
     305long long int llround( float );
    347306// extern "C" { long long int llround( double ); }
    348 static inline long long int llround( long double x ) { return llroundl( x ); }
     307long long int llround( long double );
    349308
    350309//---------------------- Manipulation ----------------------
    351310
    352 static inline float copysign( float x, float y ) { return copysignf( x, y ); }
     311float copysign( float, float );
    353312// extern "C" { double copysign( double, double ); }
    354 static inline long double copysign( long double x, long double y ) { return copysignl( x, y ); }
    355 
    356 static inline float frexp( float x, int * ip ) { return frexpf( x, ip ); }
     313long double copysign( long double, long double );
     314
     315float frexp( float, int * );
    357316// extern "C" { double frexp( double, int * ); }
    358 static inline long double frexp( long double x, int * ip ) { return frexpl( x, ip ); }
    359 
    360 static inline float ldexp( float x, int exp2 ) { return ldexpf( x, exp2 ); }
     317long double frexp( long double, int * );
     318
     319float ldexp( float, int );
    361320// extern "C" { double ldexp( double, int ); }
    362 static inline long double ldexp( long double x, int exp2 ) { return ldexpl( x, exp2 ); }
    363 
    364 static inline [ float, float ] modf( float x ) { float i; x = modff( x, &i ); return [ i, x ]; }
    365 static inline float modf( float x, float * i ) { return modff( x, i ); }
    366 static inline [ double, double ] modf( double x ) { double i; x = modf( x, &i ); return [ i, x ]; }
     321long double ldexp( long double, int );
     322
     323[ float, float ] modf( float );
     324float modf( float, float * );
     325[ double, double ] modf( double );
    367326// extern "C" { double modf( double, double * ); }
    368 static inline [ long double, long double ] modf( long double x ) { long double i; x = modfl( x, &i ); return [ i, x ]; }
    369 static inline long double modf( long double x, long double * i ) { return modfl( x, i ); }
    370 
    371 static inline float nextafter( float x, float y ) { return nextafterf( x, y ); }
     327[ long double, long double ] modf( long double );
     328long double modf( long double, long double * );
     329
     330float nextafter( float, float );
    372331// extern "C" { double nextafter( double, double ); }
    373 static inline long double nextafter( long double x, long double y ) { return nextafterl( x, y ); }
    374 
    375 static inline float nexttoward( float x, long double y ) { return nexttowardf( x, y ); }
     332long double nextafter( long double, long double );
     333
     334float nexttoward( float, long double );
    376335// extern "C" { double nexttoward( double, long double ); }
    377 static inline long double nexttoward( long double x, long double y ) { return nexttowardl( x, y ); }
    378 
    379 static inline float scalbn( float x, int exp ) { return scalbnf( x, exp ); }
     336long double nexttoward( long double, long double );
     337
     338float scalbn( float, int );
    380339// extern "C" { double scalbn( double, int ); }
    381 static inline long double scalbn( long double x, int exp ) { return scalbnl( x, exp ); }
    382 static inline float scalbn( float x, long int exp ) { return scalblnf( x, exp ); }
    383 static inline double scalbn( double x, long int exp ) { return scalbln( x, exp ); }
    384 static inline long double scalbn( long double x, long int exp ) { return scalblnl( x, exp ); }
    385 
    386 static inline float scalbln( float x, long int exp ) { return scalblnf( x, exp ); }
     340long double scalbn( long double, int );
     341
     342float scalbln( float, long int );
    387343// extern "C" { double scalbln( double, long int ); }
    388 static inline long double scalbln( long double x, long int exp ) { return scalblnl( x, exp ); }
     344long double scalbln( long double, long int );
    389345
    390346// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.